]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.2.0362: division by zero with smoothscroll and small windows v9.2.0362
authorJaehwang Jung <tomtomjhj@gmail.com>
Sun, 19 Apr 2026 18:32:55 +0000 (18:32 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 19 Apr 2026 18:32:55 +0000 (18:32 +0000)
commit0e31fb024c846e36bb0d26d01ff179a0d1b3eae4
tree2ab46e82fc62ed977e112ef20f9fed51d1c9f7e9
parent336533b3555aaa432a33507e445dfac42809006a
patch 9.2.0362: division by zero with smoothscroll and small windows

Problem:  Resizing a smoothscrolled wrapped window to its textoff width
          with 'showbreak' can leave wrapped continuation lines with
          zero text width. win_lbr_chartabsize() still runs the partial max_head_vcol calculation in
          that state and divides by width2, crashing during redraw.
Solution: Skip that partial head calculation when the wrapped
          continuation width is zero, matching the other width2 guards
          in charset.c (Jaehwang Jung)

closes: #20012

AI-assisted: Codex

Signed-off-by: Jaehwang Jung <tomtomjhj@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/charset.c
src/testdir/test_scroll_opt.vim
src/version.c