evilissimo wrote:Hi,
I am new to CodeLite but I really like it. I've been missing an editor feature which I promptly reported and implemented (because I really love this feature in Visual Studio's Visual Assist X Plugin)
The feature is for auto closing brackets if you type any of (, [, or { it will add the corresponding counter part on the same line and keeps the caret infront of it. So you edit in-between
Is the corresponding feature request:
https://sourceforge.net/tracker/index.p ... tid=979963
The patch I have attached is also adding an option to the editor menu in the misc tab which is by default disabled. So it's possible to turn it on and off (if it sucks for example

)
Regards,
Vinzenz
Thanks for the patch, however I did not accept it for the below reasons, (but I did use your idea):
1) Since this is more of an editor feature and not something which is only relevant to C++ (for example it is useful for XML editing as well), I added the implementation at the editor level and not the context level (i.e. instead of context_cpp.cpp I added the insertion code at cl_editor.cpp)
2) The settings -> editor -> misc is not the correct place for it, so I moved it to settings -> editor -> general under Guides section
3) using EditorConfigST::Get()->GetLongValue() is an expensive operation which I prefer not to call it every time user types ([{ (since it involves querying the XML which is quite large), so:
- I moved the settings to OptionsConfig (since this is the correct place for options of type settings -> editor -> general
- It is being kept as member of LEditor class, and been initialized at SetProperties() which is called whenever the 'Settings' dialog is dismissed
4) I made the code a bit more smart: If the counter part already exist, dont add another one
But as you can guess, I liked the idea so I took the liberty of implementing it myself (hope you don't mind

)
Committed in SVN trunk.
Eran