mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 14:56:08 +00:00
fix(api/buffer): fix handling of viewport of non-current buffer
A lot of functions in move.c only worked for curwin, alternatively took a `wp` arg but still only work if that happens to be curwin. Refactor those that are needed for update_topline(wp) to work for any window. fixes #27723 fixes #27720
This commit is contained in:
@@ -890,9 +890,9 @@ int decor_virt_lines(win_T *wp, linenr_T lnum, VirtLines *lines, TriState has_fo
|
||||
}
|
||||
|
||||
assert(lnum > 0);
|
||||
bool below_fold = lnum > 1 && hasFoldingWin(wp, lnum - 1, NULL, NULL, true, NULL);
|
||||
bool below_fold = lnum > 1 && hasFolding(wp, lnum - 1, NULL, NULL);
|
||||
if (has_fold == kNone) {
|
||||
has_fold = hasFoldingWin(wp, lnum, NULL, NULL, true, NULL);
|
||||
has_fold = hasFolding(wp, lnum, NULL, NULL);
|
||||
}
|
||||
|
||||
const int row = lnum - 1;
|
||||
|
Reference in New Issue
Block a user