[vim/vim] "zb" scrolls incorrectly with cursor just above fold (PR #20923)

0 views
Skip to first unread message

zeertzjq

unread,
6:59 PM (1 hour ago) 6:59 PM
to vim/vim, Subscribed

Problem: "zb" scrolls incorrectly with cursor just above fold.
Solution: Handle boff.lnum being set to the last line of a fold.

With the cursor just above fold, botline_forw() moves boff.lnum to the
last line of the fold, but curwin->w_botline is at the first line of the
fold, so the boff.lnum == curwin->w_botline condition never holds.

Instead, check that boff.lnum has just moved to or past w_botline by
comparing its previous value with w_botline.

Also make a similar change to the loff.lnum check above for symmetry.
That one doesn't change behavior, as topline_back() sets loff.lnum to
the first line of a fold.

related: neovim/neovim#41122


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20923

Commit Summary

  • a213310 "zb" scrolls incorrectly with cursor just above fold

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20923@github.com>

Reply all
Reply to author
Forward
0 new messages