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

After the newline have to hit <tab> twice to start cycling #276

Closed
EDmitry opened this issue Jun 1, 2014 · 12 comments
Closed

After the newline have to hit <tab> twice to start cycling #276

EDmitry opened this issue Jun 1, 2014 · 12 comments

Comments

@EDmitry
Copy link

EDmitry commented Jun 1, 2014

I am trying to understand if this is an intended behavior. After I make a newline I am trying to use to cycle through all possible indentations. But when I hit the first time immediately after a newline nothing happens. Only when I hit it the second time the indentation level starts to cycle. If this is not an expected behavior I will add more information.

@ivan-m
Copy link
Contributor

ivan-m commented Jun 1, 2014

Which indentation mode?

@EDmitry
Copy link
Author

EDmitry commented Jun 1, 2014

This is all I have in my .emacs:

(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/"))
(package-initialize)
(require 'haskell-mode)
(add-hook 'haskell-mode-hook (lambda () 
                               (turn-on-haskell-indent)))

@EDmitry
Copy link
Author

EDmitry commented Jun 5, 2014

So is this expected or this is an issue?

@ivan-m
Copy link
Contributor

ivan-m commented Jun 5, 2014

I believe so; it's been a while since I used haskell-indent but I think the first one makes sure it's lined up to where it "should" be and then the cycle starts.

@EDmitry
Copy link
Author

EDmitry commented Jun 5, 2014

It would be awesome if this was customizable because in 90% of cases it seems like tab is used immediately after newline, so it's already indented and after that tab is used to "fix" the indentation.

@EDmitry
Copy link
Author

EDmitry commented Mar 10, 2015

Found this old indentation bug/ feature request of mine. gracjan, could you please confirm this is indeed an intended behavior or a bug? Reproduces with hi2 too unfortunately.

Note: this only reproduces immediately after the newline when there are only two possible indentation positions. So immediately after the newline the cursor would be on the second one. After I hit <Tab> nothing happens. After I hit it one more time the cursor moves to the first indentation position.

This doesn't happen when there are three indentation positions. After the newline I would be on the second one. Hitting tab would move me to the third one instantly. Hitting tab again moves me to the first one without any issues.

@gracjan
Copy link
Contributor

gracjan commented Mar 10, 2015

In this issue you are talking about turn-on-haskell-indent wherr in #500 you are talking about haskell-indentation in hi2 branch. Those two have zero common code.

@gracjan
Copy link
Contributor

gracjan commented Mar 10, 2015

If you have example of code that has two or more indentation points and single TAB does nothing but second one moves then I'd like to see it and put it in the test suite that we have for haskell-indentation(hi2).

Note that haskell-indent is not under active development so having this issue fixed there is unlikely.

@gracjan
Copy link
Contributor

gracjan commented Mar 10, 2015

@EDmitry: I've read your comment more carefully :)

Can you paste your code that exhibits this behavior? I could not find any examples myself.

@EDmitry
Copy link
Author

EDmitry commented Mar 12, 2015

It reproduces for every line of code that has two indentation positions under it like:

main = (putStrLn . show) test

It could be related to evil-mode, so I am going to retest this without it to localize the problem. I just wasn't sure if that's a bug or an intended behavior, but now I am :-)

@gracjan
Copy link
Contributor

gracjan commented Mar 13, 2015

I cannot reproduce with current wip/hi2. Can you make sure to do:

make EMACS=$EMACS clean haskell-mode-autoloads.el

(the point is to make sure that there are no stale *.elc files getting in the way).

@gracjan
Copy link
Contributor

gracjan commented Oct 16, 2015

Reopen if there is anything to add to this particular discussion.

@gracjan gracjan closed this as completed Oct 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants