Hi.
I've just picked up Code::Blocks today and I thought I'd have a wee play with the plugin system to get me using the IDE in anger. I've made a little plugin that aligns equals characters and C++ comments. For example:
Beforesomevar1 = 1;
foo = 223;
barfoo = 12;
wibble = flibble;
squid = ferret;
/* lots of comments, doesn't matter as long as it doesn't
contain the string that's being
aligned
on
*/
After (assuming you select the lines with variables on)somevar1 = 1;
foo = 223;
barfoo = 12;
wibble = flibble;
squid = ferret;
/* lots of comments, doesn't matter as long as it doesn't
contain the string that's being
aligned
on
*/
Not the world's greatest plugin by far but it keeps my code aligned as I want it.
The plugin creates a new menu option "Aligner" in the context menu for an editor. There are two options in it, align = and align //. As soon as I can figure out how to spawn an input window then you should be able to align on any string.
I'm not sure on what needs distributing but the .cbplugin file has been renamed to .zip to get past the upload filter on the forum.
Hope somebody finds this of use. I'm off to go and make a game now :)
All the best.
[attachment deleted by admin]
A friend of mine changed the Aligner plugin:
- don't add a newline at the end of a "new aligned" block
- possibility to add other chars/strings to align to
- store/load the most used chars/strings in the config.
Thanks!!!
should do changes in two places to let it build successfully under MinGW.
First, the include path should be
..\..\..\include\wxscintilla\include
second
In line 245 of Aliger.cpp, the statement should be
control->SetSelection(pos_start, pos_end);