-
Notifications
You must be signed in to change notification settings - Fork 347
Annoying indentation behaviour when declaring data types #1081
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
Comments
I'm really grateful for these reports. Keep those coming. We will fix as soon as possible. Thanks again. |
I thought a bit more about this and I think that pressing Enter in this situation: data Foo = BarX should yield: data Foo = Bar
X that is assume by default that I will be writing arguments of data Foo = Bar Int Char
X It would be nice if entering a vertical bar in the setting above was detected and indentation corrected automatically to: data Foo = Bar Int Char
| X Note the space already inserted after the data Foo = Bar Int Char
X I would expect that repeatedly pressing Tab will cycle me between four indentations: data Foo = Bar Int Char
X Y Z Q Currently I am cycled only between |
Electric behavior for bar comma semicolon is in the plans. Hard to say when we will have energy to do this. |
Note that https://github.com/haskell/haskell-mode/blob/master/haskell-indentation.el#L188 |
This is a duplicate of #747. |
Say I have this code:
foo = undefinedX
where
X
is the cursor position. If I press Enter twice the cursor ends up at the beginning of a new line:This is all fine. Now consider a similar situation with data type declaration:
Now pressing Enter twice yields:
This is mostly annoying. If I press Enter twice after a data constructor declaration then I almost certainly want to start some new declaration and thus expect the cursor to be placed at the beginning of a new line. So the rule should be: when pressing enter on a line that contains only whitespace characters place the cursor at the beginning of a new line. Note also that current behaviour is inconsistent:
Pressing Enter here will place the cursor at the beginning of a new line, but I would really expect it to be placed under
=
:Only when I press enter for the second time I want the cursor to be placed at the beginning of a new line.
The text was updated successfully, but these errors were encountered: