Author Topic: Meaning of tidycmt?!  (Read 8243 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Meaning of tidycmt?!
« 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. :?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 836
Re: Meaning of tidycmt?!
« Reply #1 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

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: Meaning of tidycmt?!
« Reply #2 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 ?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Meaning of tidycmt?!
« Reply #3 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.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Meaning of tidycmt?!
« Reply #4 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?
Be a part of the solution, not a part of the problem.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Meaning of tidycmt?!
« Reply #5 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 :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Meaning of tidycmt?!
« Reply #6 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Meaning of tidycmt?!
« Reply #7 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." :)
Be a part of the solution, not a part of the problem.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Meaning of tidycmt?!
« Reply #8 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...?! ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Meaning of tidycmt?!
« Reply #9 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:
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ