nim-mode
nim-mode copied to clipboard
Wrong indentation in object type without ref but with fields for export
Conforming Bugs
- [x] basic information
- Gentoo Linux, kernel 4.18.5
- Emacs GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-08-24
- Nim and nimsuggest version 0.19.0
- [x] Are you using latest version of nim-mode? Yes, 0.4.2 from MELPA.
- [ ] Are there message related to nim-mode in
*Messages*buffer? No. - [x] Did you read README.md?
Expected behavior:
type
Person = object
name*: string
age*: int
another*: string
Actual behavior:
# after calling 'electric-and-indent' or 'indent-region'
# (even with electric-indent-mode disabled)
type
Person = object
name*: string
age*: int
another*: string
more investigations:
only when the first field is exported the behaviour is wrong so:
type
Person* = object
name: string
age*: string
anohter*: string
is ok while
type
Person* = object
name*: string
age*: string
anohter*: string
will misbehave.
Also there's a dirty fix by inserting a space between * and :
type
Person* = object
name* : string
age*: string
anohter: string