Keep word motion working in REPL output - #4187
Open
bbatsov wants to merge 1 commit into
Open
Conversation
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`.
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.
The #3102 fix made every character of REPL output punctuation, so
M-fandC-s C-wskipped 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