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

ESC versus meta debt #7

Open
psionic-k opened this issue Jun 9, 2023 · 0 comments
Open

ESC versus meta debt #7

psionic-k opened this issue Jun 9, 2023 · 0 comments

Comments

@psionic-k
Copy link
Member

ESC is a key. Meta is a modifiier. However, due to the esc-map's bizarre relationship with the global map, looking up meta-whatever in the global map will find whatever in the esc-map and so will ESC whatever, using ESC as a prefix in the global map and looking up whatever in the esc-map.

This ambiguity between key and modifier means that predicates that decide based on modifiers or sequence lengths need these sequences normalized to produce the expected results.

  • Sequences that are [ESC <up>], a two key sequence, are more likely to be entered as [M-<up>]
  • Some sequences are displayed as [M-ESC ESC] like for keyboard-escape-quit, but in reality, ESC ESC ESC is likely to be entered that way
  • Combinations of these require folding or unfolding, depending on whether there's just one meta or a triple of escapes
  • The global map workaround is currently to prefix every esc-map sequence with an additional meta and then list the result as a global map binding, which is effectively true and works downstream when binding, unbinding, or looking up keys
  • Some maps such as the company map, bind [ESC <escape> <escape>] etc, so we need more normalization still

Finally, when unbinding, the true sequence has to be unbound. While we want to display a sequence that the user expects to use, it's still necessary to preserve the true binding for any generation of un-bindings or when checking the difference between current bindings and the user's declared binding goals.

Most of these problems have already been worked around, but there's some mismatches that linger. This issue provides the context for future debugging as actual problems present themselves in practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant