[vim/vim] line('w$') report wrong value in terminal windows (Issue #19503)

5 views
Skip to first unread message

ubaldot

unread,
Feb 25, 2026, 4:31:46 AMFeb 25
to vim/vim, Subscribed
ubaldot created an issue (vim/vim#19503)

Steps to reproduce

vim --clean
:terminal
dir
<c-w>N:echo line('w$')<cr>

Expected behaviour

The :echo command from the above example should display a number greater than 1.

The same issue happens with line('w0') if the terminal buffer number of lines is larger than the terminal window height.
However, line('$') return the correct number.

Version of Vim

9.2 1-45

Environment

Windows 11
gvim

Logs and stack traces


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19503@github.com>

h_east

unread,
Feb 25, 2026, 8:12:28 AMFeb 25
to vim/vim, Subscribed
h-east left a comment (vim/vim#19503)

In my environment, the value is always greater than 1.
(Windows 11 Home, gVim 9.2.51 (64bit). Installed from https://github.com/vim/vim-win32-installer/releases)


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19503/3959167198@github.com>

ubaldot

unread,
Feb 25, 2026, 8:45:04 AMFeb 25
to vim/vim, Subscribed

Closed #19503 as completed.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/19503/issue_event/23069022769@github.com>

ubaldot

unread,
Feb 25, 2026, 8:47:49 AMFeb 25
to vim/vim, Subscribed
ubaldot left a comment (vim/vim#19503)

I erroneously closed the issue.
I corrected the example to reproduce.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19503/3959363545@github.com>

zeertzjq

unread,
Feb 25, 2026, 8:53:18 AMFeb 25
to vim/vim, Subscribed

Reopened #19503.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/19503/issue_event/23069259418@github.com>

LolPopGames

unread,
Mar 10, 2026, 12:04:42 PM (2 days ago) Mar 10
to vim/vim, Subscribed
LolPopGames left a comment (vim/vim#19503)

As I understand it, these values ​​are updated only when the tty size of the terminal changes

For example, if we do this (after reproducing what the author says):

<c-w>:new<cr><c-w>j<c-w>:echo line('w$')<cr>

And now an up to date value will be displayed

If we create even more lines, then we need to somehow resize the window again


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19503/4032627228@github.com>

Christian Brabandt

unread,
Mar 11, 2026, 4:45:44 PM (20 hours ago) Mar 11
to vim/vim, Subscribed

Closed #19503 as completed.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/19503/issue_event/23484600634@github.com>

Christian Brabandt

unread,
Mar 11, 2026, 4:45:46 PM (20 hours ago) Mar 11
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19503)

fixed as of ffeb233


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19503/4042097817@github.com>

Reply all
Reply to author
Forward
0 new messages