Repository navigation
Skip evil-escape's speculative first-key insert in ghostel buffers - #598
Merged
Merged
Conversation
evil-escape previews the first key of its chord (e.g. jk) with a speculative self-insert-command it reverts moments later, guarded by buffer-read-only. Since live terminal buffers became writable for the foreign-edit interceptor, that preview was captured and forwarded to the PTY where it cannot be reverted: a lone first key reached the shell twice, and a completed chord leaked it once before entering normal state. evil-ghostel now gates evil-escape--insert with :before-while advice returning nil in ghostel buffers, so the preview is skipped and the chord works through read-event alone, as it did while the buffer was read-only. The advice is installed at top level; nadvice keeps it pending until evil-escape defines the function, covering either load order. Fixes #597
This branch was previously deployed
This file contains hidden or 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
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.
evil-escape previews the first key of its chord (e.g.
jk) with a speculativeself-insert-commandit reverts moments later, guarded bybuffer-read-only. Since live terminal buffers became writable for the foreign-edit interceptor (0.47.0), that preview was captured and forwarded to the PTY where it cannot be reverted: a lone first key reached the shell twice (jj), and a completed chord leaked it once before entering normal state.evil-ghostel now gates
evil-escape--insertwith:before-whileadvice returning nil in ghostel buffers, so the preview is skipped and the chord works throughread-eventalone, exactly as it did while the buffer was read-only. The advice is installed at top level; nadvice keeps it pending until evil-escape defines the function, covering either load order. Users without evil-escape are unaffected (the advice stays inert on the undefined symbol).Verified end-to-end in live sandboxed Emacs sessions (evil + evil-escape
"jk"+ evil-ghostel, raw TTY key injection through the real command loop), in both load orders: a lonejis sent to the PTY exactly once and stays in insert state;jksends nothing, enters normal state, and leaves the prompt line clean. Includes a regression test covering the advice gating.Fixes #597