[vim/vim] screen: the wrong array is copied into ScreenCols on a resize (PR #20961)
h_east (Vim Github Repository) <[email protected]> Thu, 06 Aug 2026 08:16:40 -0700
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <vim/vim/pull/[email protected]> |
```
Problem: When the screen is resized without clearing, screenalloc() copies
ScreenAttrs[] into the new ScreenCols[] instead of ScreenCols[],
so the virtual columns are replaced by attribute values. Since
colnr_T is twice the size of sattr_T it also reads twice the
intended number of bytes.
Solution: Copy from ScreenCols[].
```
---
No visible symptom, so no test.
The only reader of `ScreenCols[]` is `mouse.c`, guarded by
`curwin->w_redr_type <= UPD_VALID_NO_UPDATE`. The stale values exist only
between the resize and the next redraw, when that guard is false, and
`drawline.c` has rewritten them by the time the array is read. The over-long
read stays inside `ScreenAttrs[]`, ending at exactly
`(screen_Rows + 1) * screen_Columns`.
You can view, comment on, or merge this pull request online at:
https://github.com/vim/vim/pull/20961
-- Commit Summary --
* screen: the wrong array is copied into ScreenCols on a resize
-- File Changes --
M src/screen.c (2)
-- Patch Links --
https://github.com/vim/vim/pull/20961.patch
https://github.com/vim/vim/pull/20961.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/pull/20961
You are receiving this because you are subscribed to this thread.
Message ID: <vim/vim/pull/[email protected]>
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/20961%40github.com.