Author Topic: More smart indent...  (Read 6177 times)

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
More smart indent...
« on: December 08, 2012, 09:55:39 pm »
I have to say that I am finding SmartIdent pretty dumb at times  :P

If I have typed this:

Code
var1 + var2 + c*var3

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

Now I go and complete the brace and I have

Code
b*()var1 + var2)|

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)

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: More smart indent...
« Reply #1 on: December 09, 2012, 12:11:25 am »
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...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: More smart indent...
« Reply #2 on: December 09, 2012, 12:55:46 am »
This sidesteps the problem, but actually solving it sounds to be a bit more difficult...
In fact it is pretty easy: Settings -> Editor -> Editor settings -> Brace completion -> Off

BTW: The Alt-I brace completion example has bad undo behaviour.
« Last Edit: December 09, 2012, 12:57:30 am by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]