Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: MortenMacFly on December 19, 2008, 02:34:28 pm

Title: Meaning of tidycmt?!
Post by: MortenMacFly on December 19, 2008, 02:34:28 pm
Can anyone tell me what's the meaning of the tidycmt plugin?
It absolutely annoying that it keeps setting the cursor to the first position every time you save a file. I looked through a lot of things before I found out there is a tiny (new) plugin that does such bullshit. :?
Title: Re: Meaning of tidycmt?!
Post by: byo on December 20, 2008, 12:12:39 pm
Answering Thomas comment from tidycmt.cpp:46

You can use:
Code
    Ctrl->SetTargetStart(Position);
    Ctrl->SetTargetEnd(EndPosition);
    Ctrl->ReplaceTarget(Code);

In this way the position of cursor won't change.

BTW. Shouldn't this plugin be placed into contrib ones ? It's not really the core of Code::Blocks

BYO
Title: Re: Meaning of tidycmt?!
Post by: killerbot on December 20, 2008, 02:44:30 pm
I think so too, it should be in contrib, and does it have the makefile stuff in order ?
Title: Re: Meaning of tidycmt?!
Post by: Jenna on December 20, 2008, 03:05:12 pm
I think so too, it should be in contrib, and does it have the makefile stuff in order ?

Not even a unix project-file.
I can upload the project-file and create the automake files.
Title: Re: Meaning of tidycmt?!
Post by: Biplab on December 21, 2008, 05:15:11 am
What about the other few plugins such as LogHacker, ModPoller? Do they need to be included as core plugin?
Title: Re: Meaning of tidycmt?!
Post by: thomas on December 22, 2008, 09:10:16 am
Quote
Can anyone tell me what's the meaning of the tidycmt plugin?
It reformats separator comments so they're all the same width. Yes those things of which 20,000 are contained every source file of yours. I have only a few of them in every source file, but it annoys the hell out of me to edit their length by hand every time. That's something a computer can do better than myself. So, that's what this plugin does.

Quote
It absolutely annoying that it keeps setting the cursor to the first position every time you save a file. I looked through a lot of things before I found out there is a tiny (new) plugin that does such bullshit. :?
1. The plugin is not included in the core build. I've neither added it to the main project, nor is it included in the automake process (because I wouldn't know how to do that anyway). Therefore, you must have compiled it manually, so don't complain about it.  8)
2. Tell me a way to change a line that does not make Scintilla scroll, and I'll be happy to change it accordingly. Having said that, I'll try Byo's snippet as soon as I've woken up properly.

What about the other few plugins such as LogHacker, ModPoller? Do they need to be included as core plugin?
LogHacker was a proof of concept plugin to demonstrate the ability to create loggers and redirect the system logs. As such, it is not really useful. However, it logically probably still belongs into the core, as kind of "demo".
ModPoller implements more frequent (actually, more correct) polling of modifications, so externally modified files are detected when it happens, not only when minimizing/maximizing the application. That's something that probably should be implemented in the core. I don't remember why I made it a plugin back then... probably there was a single person who said "but I don't want this". Who knows :)

Quote
Not even a unix project-file. I can upload the project-file and create the automake files.
No objections, if you would like to have it built by default. Since automake files aren't my thing, it will probably never happen if you wait until I'm doing it. Thanks in advance. :)

Quote
I think so too, it should be in contrib
Feel free to move it down a folder, blame my lazyness :)
Title: Re: Meaning of tidycmt?!
Post by: thomas on December 22, 2008, 09:57:27 am
I'll try Byo's snippet as soon as I've woken up properly.
This seems to work. Thank you, Byo.
Title: Re: Meaning of tidycmt?!
Post by: Biplab on December 22, 2008, 03:07:44 pm
What about the other few plugins such as LogHacker, ModPoller? Do they need to be included as core plugin?
LogHacker was a proof of concept plugin to demonstrate the ability to create loggers and redirect the system logs. As such, it is not really useful. However, it logically probably still belongs into the core, as kind of "demo".
ModPoller implements more frequent (actually, more correct) polling of modifications, so externally modified files are detected when it happens, not only when minimizing/maximizing the application. That's something that probably should be implemented in the core. I don't remember why I made it a plugin back then... probably there was a single person who said "but I don't want this". Who knows :)

IMO then ModPoller code should be included in C::B core. LogHacker can be kept at the same place. But I would prefer to have a better description of a plugin rather than "Only the fool and the wizard use this tool. Which one are you?" or "For the a*al but lazy." :)
Title: Re: Meaning of tidycmt?!
Post by: MortenMacFly on December 22, 2008, 08:51:01 pm
It reformats separator comments [...]
Good to know - so it maybe something useful, indeed.

Therefore, you must have compiled it manually, so don't complain about it.  8)
Not really - I have just automised the process of getting a complete workspace including all project files of my C::B sub-folder. I have so many plugins... I would be lost otherwise. So it surely slipped in as soon  as I SVN'ed it. ;-)

2. Tell me a way to change a line that does not make Scintilla scroll, and I'll be happy to change it accordingly.
After your explanation: It would suggest to provide the plugin with a menu entry and an option to either always run it automatically or manually via the menu entry. This way I could turn it off but still use it when I want to. I am "emulating" this behaviour now by enabling/disabling the whole plugin.

I really wonder how you lived with this scrolling but. Everything annoys you but a magic cursor does not...?! ;-)
Title: Re: Meaning of tidycmt?!
Post by: MortenMacFly on December 22, 2008, 08:53:37 pm
"For the a*al but lazy." :)
LOL! It seems you did now have found the PieceOfShitBaseClass in our sources... ;-) But don't worry - it obsolete anyways in the near future...

I can only guess if Thomas himself is the *n*l or the lazy therefore... :lol: