Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong indentation in object type without ref but with fields for export #213

Open
3 of 4 tasks
ogdenwebb opened this issue Oct 5, 2018 · 1 comment
Open
3 of 4 tasks
Labels

Comments

@ogdenwebb
Copy link

Conforming Bugs

  • 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
  • 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.
  • 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
@larme
Copy link

larme commented Jan 14, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants