Better interactive backward-kill-word #1680
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a fix to
backward-kill-word
in interactive-haskell-mode.The way things are currently implemented, calling
backward-kill-word
in the REPL causes the point to move to the beginning of the line if there is nothing else to delete on the line. The user then gets a message that the prompt text is read-only.This is annoying for two reasons:
The changes in this PR improve the ergonomics of interactive-haskell-mode by detecting when
backward-kill-word
would move past the prompt. In that case, the point is just moved to right after the prompt.I've chosen to re-bind
backward-kill-word
in thehaskell-interactive-mode-map
, and from what I can tell, it works.I've never contributed a PR to an open-source project, but I've read the wiki page on contribution guidelines. The implementation has gotten more complex since I originally opened the PR, so if you guys want unit tests, I can write those.
Old behavior:
https://asciinema.org/a/OYRtYHCAUSNZjWq2NoCn4UEdb
New behavior:
https://asciinema.org/a/fm3Gd6WV1Q7IMWMzAxwcNQTCV