aboutsummaryrefslogtreecommitdiff
path: root/scripts/lintcommit.lua
diff options
context:
space:
mode:
authorBarrett Ruth <62671086+barrettruth@users.noreply.github.com>2026-04-12 10:30:06 -0400
committerGitHub <noreply@github.com>2026-04-12 10:30:06 -0400
commitb7cbad748929f48d5a63b2ae3a6456272c2b966a (patch)
treef9d16c4ecd1884773171c4dc254fff4996f8149d /scripts/lintcommit.lua
parent52d466c500fcb0a87cfe56dc5c8cd63db67d612a (diff)
downloadrneovim-b7cbad748929f48d5a63b2ae3a6456272c2b966a.tar.gz
rneovim-b7cbad748929f48d5a63b2ae3a6456272c2b966a.tar.bz2
rneovim-b7cbad748929f48d5a63b2ae3a6456272c2b966a.zip
fix(tui): use erase_chars for short clears #38973
Problem: Due to optimizations c936ae0f3688, nvim prints literal spaces instead of using `erase_chars` in widths <= 5 even if the terminal advertises `erase_chars` support (perhaps a small-output size heuristic). However, this is not semantically neutral: in some terminals, erased cells and printed spaces are copied differently. I ended up with two useful groups of results. First, I tested raw terminal behavior without nvim involved: | Terminal | Raw plain text | Raw `erase_chars` | Raw literal spaces | | --- | --- | --- | --- | | xterm | clean | trailing spaces copied | trailing spaces copied | | xfce4-terminal | clean | clean | trailing spaces copied | Second, I tested nvim itself: | Terminal | no patch | with this patch | | --- | --- | --- | | xfce4-terminal | trailing spaces reproduced | clean | | xterm | trailing spaces reproduced | trailing spaces reproduced | | Alacritty | clean | clean | | Ghostty | clean | clean | | WezTerm | clean | clean | Nvim often prints spaces instead of sending `erase_chars`, which this patch changes for short clears when the terminal advertises it. This fixes xfce4-terminal because raw `erase_chars` are already cleaned up by the terminal, while spaces aren't. ***Notably, xterm is different***: even when `erase_chars` is sent directly (NO NVIM INVOLVED) xterm *still* copies those cleared blank trailing cells (and this is documented). So for xterm, which is the only remaining problematic fix, I'm quite sure there's nothing we ought to do on the Nvim side. Solution: Drop the `width >= 5` condition.
Diffstat (limited to 'scripts/lintcommit.lua')
0 files changed, 0 insertions, 0 deletions