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 indent in multil-line var definition with types #199

Open
3 of 6 tasks
ogdenwebb opened this issue Aug 28, 2018 · 3 comments
Open
3 of 6 tasks

Wrong indent in multil-line var definition with types #199

ogdenwebb opened this issue Aug 28, 2018 · 3 comments
Labels

Comments

@ogdenwebb
Copy link

Conforming Bugs

Please tell us below:

  • basic information
    • Gentoo Linux, kernel 4.17.4
    • 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.18.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?
  • Is your problem related to nimsuggest-mode? (company-mode, flycheck, or el-doc)
    • Did you try nim-mode without nimsugggest-mode? What happened?
      (Comment out nimsuggest-mode's config please)

Expected behavior:

var
  x, y: string
  a, b: float

Actual behavior:

# after calling 'electric-and-indent' or 'indent-region'
var
  x, y: string
a, b: float

But with a value it works well:

var
  x, y: string = "test string"
  a, b: float
@krux02
Copy link
Contributor

krux02 commented Aug 29, 2018

put (electric-indent-mode 0) from your nim-mode-hook. Electric indent has more severe problems thas this. Sometimes it blocks emacs for several seconds and then automatically screws up the entire file. It's not worth the trouble.

@ogdenwebb
Copy link
Author

@krux02 it doesn't change anything for me. With enabled and disabled electric-indent-mode in nim-mode hook the issue appears here.

As a sidenote, nim-indent-calculate-indentation returns 0 on the third line of code.

@krux02
Copy link
Contributor

krux02 commented Aug 29, 2018

@ogdenwebb you are totally right, I just tested it. My recommendation is to use var on every line. This doesn't fix but it makes the bug non relevant.

var  x, y: string
var a, b: float

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