Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
More smart indent...
(1/1)
dmoore:
I have to say that I am finding SmartIdent pretty dumb at times :P
If I have typed this:
--- Code: ---var1 + var2 + c*var3
--- End code ---
then decide that I want to multiply var1 and var2 by a, so I move my cursor back to the start and type "b*(", I get
--- Code: ---b*(|)var1 + var2 + c*var3
--- End code ---
Now I go and complete the brace and I have
--- Code: ---b*()var1 + var2)|
--- End code ---
so I get that extra closing brace in there that shouldn't be there. (Same thing happens with quotes).
Maybe the "smart" thing to do is to automatically remove the added brace if the user moves without typing anything inside the braces? (That has problems with brace autocompletions for functions without args though)
Alpha:
In that situation, I type with a slightly different habit:
|var1 + var2
type "b*"
b*|var1 + var2
press Shift-End (or Ctrl-Shift-Right) to select
b*var1 + var2|
type ")" (if selection brace completion is not active, you must press Alt-I first)
b*(var1 + var2)|
This sidesteps the problem, but actually solving it sounds to be a bit more difficult...
oBFusCATed:
--- Quote from: Alpha on December 09, 2012, 12:11:25 am ---This sidesteps the problem, but actually solving it sounds to be a bit more difficult...
--- End quote ---
In fact it is pretty easy: Settings -> Editor -> Editor settings -> Brace completion -> Off
BTW: The Alt-I brace completion example has bad undo behaviour.
Navigation
[0] Message Index
Go to full version