vscode-nim icon indicating copy to clipboard operation
vscode-nim copied to clipboard

Wrong indentation for `else`

Open narimiran opened this issue 8 years ago • 1 comments

Consider a function

proc a(b: int): int =
  if b == 1:
    return b
  else:
    return b+1

Written like the above, everything works as expected.

But if you have if part on the same line, like this:

proc a(b: int): int =
  if b == 1: return b

writing else: and pressing enter, else: gets de-indented, like this:

proc a(b: int): int =
  if b == 1: return b
else:

narimiran avatar Oct 15 '17 09:10 narimiran

The same happens for an else in a case

ghost avatar Jan 30 '18 11:01 ghost