Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

A feature I want to implement

<< < (2/3) > >>

ollydbg:

--- Code: ---a = 5 + my_func(long_arg1, long_arg2, --> hit First enter it works
                       long_arg3, long_arg4); --> hit Second enter and the cursor goes to
                       | --> here :(


--- End code ---

Great!
I'm not quite understand your idea.
Where should the cursor be after the second enter? :D

It should be like this below?:


--- Code: ---a = 5 + my_func(long_arg1, long_arg2, --> hit First enter it works
                       long_arg3, long_arg4); --> hit Second enter and the cursor goes to
| --> here :(

--- End code ---

Thanks.

oBFusCATed:
Yes, it should go to the position of "a".

dmoore:
but won't your patch do this?


--- Code: ---cout<<"(";<-- press enter
        |<-- cursor position

--- End code ---

also, why not indent for other types of braces

slightly off-topic, but one reason I despise this feature is that it encourages coders to do this:


--- Code: ---void my_func(
                  int arg1, // random gibberish comment
                  char *arg2,
                  myclass arg3, // random gibberish comment
                  )

--- End code ---

instead of


--- Code: ---// comment
void my_func(int arg1, char *arg2, myclass arg3);

--- End code ---

even worse when they then do similar crap with the call, reducing the number of effective loc that I can fit on screen without really enhancing readability of the code.

oBFusCATed:

--- Quote from: dmoore on May 13, 2009, 05:42:15 pm ---but won't your patch do this?


--- Code: ---cout<<"(";<-- press enter
        |<-- cursor position

--- End code ---

--- End quote ---

no, but


--- Code: ---cout << "(" <<

--- End code ---
will break it  :(
Any ideas what I can do to fix it?


--- Quote ---
also, why not indent for other types of braces

--- End quote ---
The '{' are handled by the indenter, '[' are not used on multiple lines (if there are no strange overloads :) ),
< require some more parsing (to distinguish if it is used in template or as operation).


--- Quote ---slightly off-topic, but one reason I despise this feature is that it encourages coders to do this:


--- Code: ---void my_func(
                  int arg1, // random gibberish comment
                  char *arg2,
                  myclass arg3, // random gibberish comment
                  )

--- End code ---

instead of


--- Code: ---// comment
void my_func(int arg1, char *arg2, myclass arg3);

--- End code ---

--- End quote ---
Isn't that a problem of the coding standard/programmer? C::B is just a tool.
And if it is such a problem a config option could be added that is off by default.


--- Quote ---
even worse when they then do similar crap with the call, reducing the number of effective loc that I can fit on screen without really enhancing readability of the code.

--- End quote ---

Do you talk about this:

--- Code: ---api_with_many_params(param1, // here we set something
                           param2, // here we set something else
                           param3, // here we set something else
                           param4, // here we set something else
                           );

--- End code ---

oBFusCATed:
Hello again,

Here is the latest version of the patch.
I've fixed lots of problems, while using it (the patch wasn't working in lots of cases)
I've fixed the cout/quotes problem (the braces inside strings are ignored).
I've also made the patch to work when "Use Tab character" option is used (I think, I do the best I can in this mode).

I hope that someone from the devs team will find some time to review it,
so I can further polish it (fix bugs, some commenting, configuration option ...).
After that I hope it will be applied to trunk.

Best regards,
Teodor Petrov

[attachment deleted by admin]

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version