-
Notifications
You must be signed in to change notification settings - Fork 344
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
Better interactive backward-kill-word #1680
Open
r-zip
wants to merge
15
commits into
haskell:master
Choose a base branch
from
r-zip:interactive-mode-backward-kill-word
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r-zip
changed the title
Interactive mode backward kill word
Better interactive mode backward kill word
Oct 26, 2019
r-zip
changed the title
Better interactive mode backward kill word
Better interactive backward-kill-word
Oct 26, 2019
Thanks for taking the time to submit this! I feel like there must be a more general way to tackle this, since many other commands exist which would need to be overridden in this way, e.g. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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