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

Reset indentation in haskell after an empty line #1704

Closed
meditans opened this issue May 24, 2015 · 5 comments
Closed

Reset indentation in haskell after an empty line #1704

meditans opened this issue May 24, 2015 · 5 comments

Comments

@meditans
Copy link

Hi, when hitting enter in haskell-mode, the cursor is usually in the middle of the line (in the most consistent place indentation-wise).

Before using spacemacs, however, I remember setting an option which resets the indentation when the user skips a line (in this way it's possible to start a new function without hitting S-Tab). However I don't find that option again.

Do you have the same problem?

@meditans meditans changed the title Resetting indentation in haskell after an empty line Reset indentation in haskell after an empty line May 24, 2015
@d12frosted
Copy link
Contributor

No, I don't have such problem. Does it still occur for you?

@d12frosted
Copy link
Contributor

@meditans could you please post the result of spacemacs/describe-system-info? Are you using shm?

Update

Oh, and also, if you have any custom haskell configurations, please specify them 😄 (if it's nothing sensitive).

@TheBB
Copy link
Contributor

TheBB commented Oct 26, 2015

This seems to have the desired effect for me.

(defun bb/stuff ()
  (when (and (< 1 (line-number-at-pos))
             (save-excursion
               (forward-line -1)
               (string= "" (s-trim (buffer-substring (line-beginning-position) (line-end-position))))))
    (delete-region (line-beginning-position) (point))))

(advice-add 'haskell-indentation-newline-and-indent
            :after 'bb/stuff)

Just dumping that here so I won't forget it.

@d12frosted
Copy link
Contributor

Ok, looks like it was me who had some funky configs - I am able to reproduce it as well. So will work on solution.

@d12frosted
Copy link
Contributor

Updated documentation in #3544.

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

5 participants