[vim/vim] feat: use getwininfo() to get displayed lines (PR #21139)

8 views
Skip to first unread message

Mao-Yining

unread,
Aug 24, 2026, 3:13:25 AM (yesterday) Aug 24
to vim/vim, Subscribed

fixes: #21134

Signed-off-by: Mao-Yining mao.y...@outlook.com


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

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

Commit Summary

  • 0da8ca6 feat: use getwininfo() to get displayed lines

File Changes

(3 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/21139@github.com>

Mao-Yining

unread,
Aug 24, 2026, 3:23:54 AM (yesterday) Aug 24
to vim/vim, Subscribed
mao-yining left a comment (vim/vim#21139)

Since this is available for only windows in this tab. Maybe it's better to use winnr. This is just a demo. I'd like to hear about whether this fucntion can be accept.


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/21139/c5391980156@github.com>

h_east

unread,
Aug 24, 2026, 6:09:31 AM (yesterday) Aug 24
to vim/vim, Subscribed
h-east left a comment (vim/vim#21139)

I do not think getwininfo() is the right place for this. w_lines[] is the
redraw cache: it holds what the last redraw of that window left behind, which
is why the documentation has to say that a window in another tab page comes
back empty, and why the test needs redraw. That ties a script interface to
when Vim happens to draw.

It also makes every getwininfo() call allocate a List of one number per
screen line for every window, and that function is called often, from
statuslines among others. If this is worth having, it should be a function of
its own, the way the title of #21134 puts it, so that only those who ask for
it pay for it.

The loop in #21134 already uses foldclosedend() to jump over a closed fold,
so it costs one step per visible line rather than per buffer line. Can you
show measurements of that being too slow?

Two smaller things: the new item is tagged {only with the +quickfix feature}, which was copied from loclist, and get_winlines() can return
NULL, which dict_add_list() dereferences (dict.c:495).


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/21139/c5393727945@github.com>

Mao-Yining

unread,
Aug 24, 2026, 6:13:10 AM (yesterday) Aug 24
to vim/vim, Subscribed
mao-yining left a comment (vim/vim#21139)

OK


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/21139/c5393769915@github.com>

Reply all
Reply to author
Forward
0 new messages