Skip to content

Leave evil insert state when entering a read-only mode - #717

Merged
dakra merged 1 commit into
mainfrom
fix/evil-readonly-entry-normal-state
Sep 30, 2026
Merged

dakra merged 1 commit into
mainfrom
fix/evil-readonly-entry-normal-state

Conversation

@dakra

@dakra dakra commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Entering copy or Emacs mode from evil insert state left insert state active. Insert state binds no printable keys, so j, k and other motions hit the read-only fast-exit map, leaving copy mode and typing the letter into the terminal.

  • New ghostel-readonly-enter-hook, run after entering copy or Emacs mode.
  • evil-ghostel uses it to switch insert state to normal state. This covers every entry path: C-c C-t, Emacs mode, prompt and link jumps, mouse selection, and search / minibuffer landings. Emacs state keeps the fast exit.

Supersedes #670: with insert state kept out of read-only modes (this PR) and read-only modes left on insert entry (#716), the fast-exit opt-out and the insert-state ESC handling there are no longer needed.

Entering copy or Emacs mode from evil insert state left insert state
active.  Insert state binds no printable keys, so j, k and other
motions hit the read-only fast-exit map, leaving copy mode and typing
the letter into the terminal.

ghostel-readonly-enter-hook runs after entering copy or Emacs mode.
evil-ghostel uses it to switch insert state to normal state, which
covers every entry path: C-c C-t, Emacs mode, prompt and link jumps,
mouse selection, and search / minibuffer landings.  Emacs state keeps
the fast exit.

The evil read-only elate suite covers C-c C-t and isearch from insert
state.  The word-boundaries suite, documented but never added, starts
each double-click in insert state and checks that the resulting visual
selection copies exactly the selected text.

Supersedes #670.
@dakra
dakra force-pushed the fix/evil-readonly-entry-normal-state branch from 4d04d3a to 8cc9173 Compare September 30, 2026 12:18
@dakra
dakra merged commit 8cc9173 into main Sep 30, 2026
33 checks passed
@dakra
dakra deleted the fix/evil-readonly-entry-normal-state branch September 30, 2026 13:54
@dakra dakra mentioned this pull request Sep 30, 2026

This branch was successfully deployed

1 active deployment
github-pages — 8cc91732 Deployed Sep 30, 2026 by dakra via deploy #208
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

Successfully merging this pull request may close these issues.

1 participant