8000 beep on unrecognized commands to warn the user by jacekkopecky · Pull Request #781 · atom/vim-mode · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Apr 6, 2018. It is now read-only.

beep on unrecognized commands to warn the user #781

Closed

Conversation

jacekkopecky
Copy link
Contributor

Alternative to #764. Instead of trying to cancel an operation, possibly running into conflict with other packages' key bindings (as discussed in #764), this PR just beeps on unrecognised key bindings.

Together with some form of showing the current pending key strokes (thought in progress), this could be a way of handling unrecognised commands that's more appropriate for Atom, even though it doesn't behave exactly like VIM.

Discussion welcome.

@bronson
Copy link
Contributor
bronson commented Jul 20, 2015

Let me see if I understand... The problem with #764 was that vim-mode thinks that it knows all possible key combinations... So, if vim-surround adds a new combination, vim-mode wouldn't recognize it and cancel it before it's complete?

Wouldn't this fix suffer the same issue...? It would beep every time it sees the unrecognized combo, even though vim-surround would do the right thing?

@jacekkopecky
Copy link
Contributor Author

This one only beeps when a single-key keystroke hasn't been matched. The problem with #764 is that it needs to react to multi-key keystrokes. Examples:

In ci3w, it sees i3 as a key binding not recognized by Atom; and Atom only attempts to match i3 because other two-key strokes starting with i exist. #764 cancels i3 and cancels c as well, in order to prevent replaying i (not recognized so no-op) and 3 which then gets tied to w.

With vim-surround, the existence of the key strokes starting with ds mean that when the user types dd, Atom waits after the first d in case s comes, and when it doesn't, Atom shouts that dd was not recognized, #764 cancels the whole thing and the two ds don't get replayed, to be combined by vim-mode.

In here - #781 - there's no canceling, just beeping, and only on single-key unmatched bindings.

Which brings me to an idea that #764 could only cancel on single-key unmatched bindings. That should take care of interactions with vim-surround. We'll see momentarily.

@jacekkopecky
Copy link
Contributor Author

I think I prefer this approach (beep on unrecognized key strokes, without canceling any) to the approach of #764 which tries to cancel pending commands but may delay user feedback.

Neither of these two PRs can copy VIM's behaviour, but it's about handling erroneous input so there should be no consideration of muscle memory.

@jacekkopecky
Copy link
Contributor Author

oh boy, tiny merge conflict with #827 - I'll be happy to rebase as soon as that one is merged

@jacekkopecky jacekkopecky force-pushed the beep-on-unrecognized-commands branch from b67f88e to c6a4080 Compare August 31, 2015 16:14
@jacekkopecky
Copy link
Contributor Author

OK, this one is now ready; please see my comment above when considering this.

@lee-dohm
Copy link
Contributor
lee-dohm commented Apr 5, 2018

As stated in the README, this package is no longer maintained and is deprecated. We recommend that people use the vim-mode-plus package instead. Because of this, we are archiving this repository and closing all issues and pull requests. Thanks very much for your support and contributions!

@lee-dohm lee-dohm closed this Apr 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0