Skip to content

Keep word motion working in REPL output - #4187

Open
bbatsov wants to merge 1 commit into
masterfrom
fix-repl-output-word-motion
Open

Keep word motion working in REPL output#4187
bbatsov wants to merge 1 commit into
masterfrom
fix-repl-output-word-motion

Conversation

@bbatsov

@bbatsov bbatsov commented Sep 10, 2026

Copy link
Copy Markdown
Member

The #3102 fix made every character of REPL output punctuation, so M-f and C-s C-w skipped over whole output blocks. Output now gets a syntax table with only the delimiters demoted, which keeps the sexp scanner safe and word motion intact. The same property also leaked into yanked text, so it's excluded from yanks now.

Fixes #4154

The #3102 fix stamped every character of REPL output with punctuation
syntax so unbalanced parens in output couldn't break sexp navigation.
That also turned every word in output into punctuation, so `M-f`/`M-b`
and `isearch-yank-word-or-char` jumped over an entire output block
instead of a word at a time.

Attach a syntax table to the output instead, derived from the REPL's
own with every delimiter class (parens, string quotes, comment
starters, escapes) demoted to punctuation. Words, symbols and
whitespace keep their syntax, non-ASCII brackets are covered too, and
the property is a single interval per output chunk rather than one per
character.

Also exclude that property from yanks, so a form copied out of the
output and pasted at the prompt has its parens counted again by
`cider-repl--input-complete-p`.
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.

Can no longer isearch-yank-word-or-char in the REPL buffer

1 participant