-
Notifications
You must be signed in to change notification settings - Fork 347
New indentation — using backspace to move to the previous indentation position #500
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 visited the hi2 repo and found out that this is expected ( |
In #276 should affect only So this is not a bug. |
Is there a possibility to add an option to bind it back? I realized I kind of got used to it and don't mind any possible problems with it (I didn't experience any to be honest). It's hard to do anything with muscle memory once it has been acquired. |
Can you bind to unindent for you locally, use it a little and see how it feels? In theory binding is a good idea, in practice there were problems with exact mechanics how it should work. has already many options associated with it in Emacs. Can you find out how other modes for indentation-based languages bind edit keys? Python mode usually is a good reference point. |
I have tried Python and it seems like
|
I've just updated my haskell-mode from an ancient version and immediately noticed the lack of this feature. My problem is not that unindent-or-delete-backwards is not bound to backspace by default; the problem is that I don't see where the functionality is implemented! (in v13.14.2) Does that mean I need to revert to my old version from 2012 to get this functionality back? |
Would something like this work? (defun haskell-indentation-at-beginning-of-line ()
(and
(not (= (current-column) 0))
(= (haskell-indentation-current-indentation) (current-column))))
(defun haskell-indentation-unindent-or-delete-backwards ()
(interactive)
(if (haskell-indentation-at-beginning-of-line)
(haskell-indentation-indent-backwards)
(backward-delete-char 1))) |
Authors of haskell-indentation provided two ways to control indentation:
|
Yes, and neither of them is what I and the OP want. With the I'll prepare a proper pull request that adds these functions and maps
|
I wasn't the one deciding to remove this functionality.
Please remember to add test cases in `tests` directory for the new
functionality you are providing.
Note that TAB-cycle functionality is also buggy at this point. Since you
are going to fix that part of the code you could look also in this issue.
Please also extend documentation so that it mentions all the
TAB/S-TAB/backspace options to handle indentation.
Thanks!
|
unindent instead of deleting a single character. This restores the old behaviour mentioned in `haskell-indentation-mode`'s docstring. See haskell#500
@EDmitry can you try my pull request and see if it works for you? |
…nindent instead of deleting a single character. This restores the old behaviour mentioned in `haskell-indentation-mode`'s docstring. See haskell#500
I have noticed one difference between original haskell-indentation and the new one. If I have (the cursor position is indicated with
^
):Hitting
<Backspace>
would move the cursor to the beginning of the line (the previous valid indentation position), but in the new indentation mode it just deletes one space.I haven't looked more closely why this happens, but I have verified the difference exists when just switching branches, so all other settings are completely identical in my set up.
The text was updated successfully, but these errors were encountered: