pragmagic / vscode-nim

An extension for VS Code which provides support for the Nim language.
Other
237 stars 37 forks source link

Wrong indentation for `else` #69

Open narimiran opened 6 years ago

narimiran commented 6 years ago

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:
ghost commented 6 years ago

The same happens for an else in a case