-
-
Notifications
You must be signed in to change notification settings - Fork 898
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Use overriding-terminal-local-map instead of trusting the overla…
…y keymap Despite having higher priority, the inline completion overlay keymap may not be active when other overlays around point also define a keymap. This can be observed with smartparens -- upon inserting a pair, smartparens creates an overlay to track the inserted pair. This overlay has a keymap binging only `C-g`. Nonetheless, if the user triggers inline completions inside a recently inserted pair such as the example below (cursor at `|') value = [ | ] then the inline completion shown at `|' would now have its keymap active. In that case, pressing `C-g' once would call the smartparens function that removes the current overlay, and afterwards the inline completion overlay would be active. This results in weird behaviours -- e.g. pressing `C-g' once does not cancel the suggestion, but twice does; Pressing `C-<return>' results in a "C-<return> is undefined" message, etc. This change updates the inline completion mechanism to use `overriding-terminal-local-map`. This ensures that the inline completion keymap is active when the overlay is shown (see https://www.gnu.org/software/emacs/manual/html_node/elisp/Searching-Keymaps.html). Since the inline completion keymap binds `[t]' to a "hide and execute whatever command was bound before", we end up with the expected behaviour of the overlay keymap.
- Loading branch information
Showing
1 changed file
with
37 additions
and
31 deletions.
There are no files selected for viewing
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