Open RSDuck opened 7 years ago
It is because onEnterRules
conflicts with decreaseIndentPattern
in this case.
I guess onEnterRules
breaks inner indent counters state of VSCode, It is possible use this workaround:
beforeText: /^\s*((return|break|continue|raise))\s*$/,
action: { indentAction: vscode.IndentAction.None, removeText: 2 }
but it will work only for fixed tab size
Yes it does works. Hm I'm wondering if there's a real fix to this problem(beside just leaving it as is it/removing the ((return|break|continue|raise)\n)
from the regex)...
I found this passage of the code very interesting:
I assume the
(return|break|continue|raise)\n
should decrease the identation in the next line, when the user types return, break, continue or raise. But this doesn't work.I got it to work by adding the following to the onEnterRules:
But this results in the following bug:
(| is where the cursor is) When
return
is typed, the next line gets outdented once after typing enter. Then whenelse:
is typed, theelse
outdents once again. Now theelse
is too far outdented.And that's why I'm asking if this is intended, or not?