Repository navigation
Always leave read-only mode on exit; keep evil insert out of it - #716
Merged
Merged
Conversation
Exiting copy or Emacs mode now returns to the last mode that was not read-only, even after switching between the two. A key typed in copy mode entered from Emacs mode reaches the terminal instead of being dropped. evil-ghostel: entering insert state from copy or Emacs mode exits to the terminal and keeps point's column on the cursor row, clamped to the input start after a detected prompt. In normal and motion state, ghostel-prompt-navigation-input-mode and ghostel-point-leave-input-mode are nil buffer-locally, so prompt jumps and search / minibuffer landings stay in semi-char where the terminal-aware j / G / i / a work. Other states keep ghostel's switches. The navigation option gains a nil choice. ghostel--cursor-row-input-start holds the cursor-row prompt detection shared by ghostel-input-start-point, line mode's startup entry, and the evil clamp. New elate suites cover read-only modes with and without evil. Fixes #715.
dakra
force-pushed
the
fix/evil-insert-readonly
branch
from
September 30, 2026 07:52
3f58fbb to
f1860ff
Compare
This was referenced Sep 30, 2026
Closed
This branch was successfully 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.
Fixes #715.
Core
ghostel-readonly-exitalways leaves read-only mode. Switching between copy and Emacs mode keeps the mode active before the first read-only entry, so Emacs → copy → exit lands in semi-char (or char), not back in Emacs mode. A key typed in copy mode entered from Emacs mode now reaches the terminal instead of being dropped by the fast-exit handler.ghostel--cursor-row-input-startholds the cursor-row prompt detection (OSC 133 prop, thenghostel-prompt-regexp) previously duplicated inghostel-input-start-pointand line mode's startup check.ghostel-prompt-navigation-input-modeaccepts nil.evil-ghostel
C-z) keeps copy mode.ghostel-prompt-navigation-input-modeandghostel-point-leave-input-modeare nil buffer-locally, so[[/]],/search, and minibuffer landings stay in semi-char, where the terminal-awarej/G/i/awork. Insert and Emacs state keep ghostel's default copy-mode switch.Note on the issue's diagnosis: under
emacs -Qthe fast-exit remap still fires in insert state, so the "every key is read-only" symptom depends on the user's config (orghostel-readonly-fast-exitnil). Insert state in a read-only buffer is wrong either way.Testing
make -j8 allpasses; new ERT tests run in CI's module-lesstest-eviljob and fail without the fix.test/elate/matrix/readonly-evil-ghostel.jsonandreadonly-ghostel.json(zsh) pass every group.~XPASSes on every shell on main as well (it no longer signals read-only, but the edit still does not land);Pon nu XPASSes on this branch.