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

Haskell indentation weirdly re-indents lines after sp-kill-sexp #1031

Closed
mrkkrp opened this issue Dec 23, 2015 · 9 comments
Closed

Haskell indentation weirdly re-indents lines after sp-kill-sexp #1031

mrkkrp opened this issue Dec 23, 2015 · 9 comments

Comments

@mrkkrp
Copy link
Contributor

mrkkrp commented Dec 23, 2015

I don't know why this happens, quick serch doens't show any relevant hook or advices in haskell-indentation.hs. However, when you call sp-kill-sexp (from Smartparens) with haskell-indentation-mode enabled, current line is weirdly re-indented after deletion of the sexp. So, every time you need to re-indent it.

@mrkkrp
Copy link
Contributor Author

mrkkrp commented Dec 23, 2015

It also happens after sp-kill-hybrid-sexp and who knows what else. Ahhh…

@mrkkrp
Copy link
Contributor Author

mrkkrp commented Dec 23, 2015

There must be a way to disable re-indenting after this sort of operations.

@gracjan
Copy link
Contributor

gracjan commented Dec 23, 2015 via email

@mrkkrp
Copy link
Contributor Author

mrkkrp commented Dec 23, 2015

To add tests for this, we first need to understand why exactly this happens. I don't think installing smartparens package only to test these cases is the right thing to do. Most probably we're seeing something that has nothing to do with smartparens, but just somehow is visible in this case.

@gracjan
Copy link
Contributor

gracjan commented Dec 23, 2015

If the test could test that 'something' without smartparens then that is even better in my book.

@bergey
Copy link
Contributor

bergey commented Dec 23, 2015

After killing, smartparens calls sp--cleanup-after-kill which calls sp--indent-region. You can turn this off (for haskell) with (add-to-list 'sp-no-reindent-after-kill-modes 'haskell-mode)

I suppose this makes sense in languages that delimit blocks with characters rather than indentation. The other values of sp-no-reindent-after-kill-modes seem to confirm this.

@gracjan
Copy link
Contributor

gracjan commented Dec 23, 2015

In this case this issue is a duplicate of #796. Closing as dupe.

@gracjan gracjan closed this as completed Dec 23, 2015
@gracjan
Copy link
Contributor

gracjan commented Dec 23, 2015

Noted the need of indent-region in #1032.

@mrkkrp
Copy link
Contributor Author

mrkkrp commented Dec 23, 2015

Perfect, thanks guys!

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

No branches or pull requests

3 participants