Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
A feature I want to implement
oBFusCATed:
Hello,
I have an idea for a new feature, but I don't know where to start/what to modify, can you help me?
Here is the idea:
When I type a very long function definition/declaration/call, I hit enter to make the line shorter an more readable.
The current behavior on this action is to send the cursor at the beginning of the next line + 1 tab (I think).
I want to make it to go to the first opening bracket '(', so I can type:
--- Code: ---void mylongfunc(int param1, 'hit enter here and directly go to the bracket and type the second param'
int param2, ' ... and so on so forth'
--- End code ---
The MS VC has that feature for function definitions, I want to expand it to definitions and callings.
Where do I need to hack :lol: :P?
Best regards,
Teodor
dmoore:
open codeblocks.cbp
ctrl-shift-f, search the project for SMART INDENTING
I would think that you won't need to hand parse the text. You should be able to use the lexing info in scintilla to find the position of the opening brace.
ollydbg:
You can look into this thread for a reference:
http://forums.codeblocks.org/index.php/topic,10361.0.html
oBFusCATed:
Thank you,
I'll take a look at it, tonight.
Yesterday, I've done some experimenting and I have the basic feature working.
I need to polish it and add some improvements.
Then I'll show it, so more testing can be done.
oBFusCATed:
Here is the patch,
It only one major problem:
--- Code: ---a = 5 + my_func(long_arg1, long_arg2, --> hit enter it works
long_arg3, long_arg4); --> hit enter and the cursor goes to
| --> here :(
a = 5 + my_func(long_arg1, long_arg2); --> here it works
| --> cursor is here after enter is hit
--- End code ---
Is there a way to get the indent level of the previous statement or something similar.
It can stay that way, it is not mega annoying, but I prefer to make it better?
Feedback is welcome :)
p.p. Patch is attached to the post
[attachment deleted by admin]
Navigation
[0] Message Index
[#] Next page
Go to full version