News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Meaning of tidycmt?!

Started by MortenMacFly, December 19, 2008, 02:34:28 PM

Previous topic - Next topic

MortenMacFly

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. :?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

byo

Answering Thomas comment from tidycmt.cpp:46

You can use:

    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

killerbot

I think so too, it should be in contrib, and does it have the makefile stuff in order ?

Jenna

Quote from: 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 ?

Not even a unix project-file.
I can upload the project-file and create the automake files.

Biplab

What about the other few plugins such as LogHacker, ModPoller? Do they need to be included as core plugin?
Be a part of the solution, not a part of the problem.

thomas

QuoteCan 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.

QuoteIt 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.

Quote from: Biplab on December 21, 2008, 05:15:11 AMWhat 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 :)

QuoteNot 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. :)

QuoteI think so too, it should be in contrib
Feel free to move it down a folder, blame my lazyness :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

thomas

Quote from: thomas on December 22, 2008, 09:10:16 AMI'll try Byo's snippet as soon as I've woken up properly.
This seems to work. Thank you, Byo.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Biplab

Quote from: thomas on December 22, 2008, 09:10:16 AM
Quote from: Biplab on December 21, 2008, 05:15:11 AMWhat 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." :)
Be a part of the solution, not a part of the problem.

MortenMacFly

Quote from: thomas on December 22, 2008, 09:10:16 AM
It reformats separator comments [...]
Good to know - so it maybe something useful, indeed.

Quote from: thomas on December 22, 2008, 09:10:16 AM
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. ;-)

Quote from: thomas on December 22, 2008, 09:10:16 AM
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...?! ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

MortenMacFly

Quote from: Biplab on December 22, 2008, 03:07:44 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:
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]