render active selection in reverse video
Extend the inlined readline redraw path with a three-segment render
when the selection is live: plain prefix, ESC[7m...ESC[27m for the
selected bytes, plain suffix. Syntax highlighting is skipped for the
whole line while a selection is active — partial-token highlighting
on the out-of-selection segments produced false command/keyword
colors, and most editors drop syntax colors inside the selection
anyway.
Reverse video is the same pattern the prefix-search renderer uses at
readline.f90:1664 — proven across Terminal.app, iTerm2, Ghostty, and
the mainstream Linux terminals. ESC[27m is used over ESC[0m to clear
only reverse video, leaving any other attributes the prompt set
behind untouched.
New local sel_start/sel_end integers are declared at subroutine scope
(not inside a block) to stay compatible with the inlined-redraw
workaround for flang-new's large-derived-type ABI bug. No new
subroutine calls — the whole render lives in the existing redraw
block.
Tests: 4 new assertions in selection.yaml that force
FORTSH_TEST_MODE=0 and match on the literal ESC[7m...ESC[27m pattern
around the selected text. Sprint 1's 15 behavioral tests still pass
(they run in test mode, skipping the full redraw path entirely).
Adjacent specs — line_editing, history, vi_mode, completion,
signals_jobs, prompt_display, stress — all clean: 267 tests total
with zero regressions.
when the selection is live: plain prefix, ESC[7m...ESC[27m for the
selected bytes, plain suffix. Syntax highlighting is skipped for the
whole line while a selection is active — partial-token highlighting
on the out-of-selection segments produced false command/keyword
colors, and most editors drop syntax colors inside the selection
anyway.
Reverse video is the same pattern the prefix-search renderer uses at
readline.f90:1664 — proven across Terminal.app, iTerm2, Ghostty, and
the mainstream Linux terminals. ESC[27m is used over ESC[0m to clear
only reverse video, leaving any other attributes the prompt set
behind untouched.
New local sel_start/sel_end integers are declared at subroutine scope
(not inside a block) to stay compatible with the inlined-redraw
workaround for flang-new's large-derived-type ABI bug. No new
subroutine calls — the whole render lives in the existing redraw
block.
Tests: 4 new assertions in selection.yaml that force
FORTSH_TEST_MODE=0 and match on the literal ESC[7m...ESC[27m pattern
around the selected text. Sprint 1's 15 behavioral tests still pass
(they run in test mode, skipping the full redraw path entirely).
Adjacent specs — line_editing, history, vi_mode, completion,
signals_jobs, prompt_display, stress — all clean: 267 tests total
with zero regressions.
- SHA
67e4cc711e621b7264abe6f21fafe8b41fee0ada- Parents
-
81a91f7 - Tree
0d38896