fix(api): update topline when flushing with nvim__redraw() (#34346)

Problem:  nvim__redraw may update the screen with an invalid topline.
Solution: Update the topline before calling `update_screen()` (as
          :redraw does).
This commit is contained in:
luukvbaal
2025-06-07 11:24:24 +02:00
committed by GitHub
parent 22389159f5
commit af82f36108
2 changed files with 30 additions and 0 deletions

View File

@ -2376,6 +2376,8 @@ void nvim__redraw(Dict(redraw) *opts, Error *err)
// Redraw pending screen updates when explicitly requested or when determined
// that it is necessary to properly draw other requested components.
if (opts->flush && !cmdpreview) {
validate_cursor(curwin);
update_topline(curwin);
update_screen();
}