Skip to content

:redrawstatus does not update the ruler in the last window - #20865

Open
h-east wants to merge 2 commits into
vim:masterfrom
h-east:redrawstatus-ruler-lastwin
Open

:redrawstatus does not update the ruler in the last window#20865
h-east wants to merge 2 commits into
vim:masterfrom
h-east:redrawstatus-ruler-lastwin

Conversation

@h-east

@h-east h-east commented Jul 29, 2026

Copy link
Copy Markdown
Member
Problem:  When the last window has no status line the ruler takes its
          place in the last screen line, but ":redrawstatus" and
          re-setting 'rulerformat' or 'statusline' do not update it
          there.  An item such as a clock in 'rulerformat' can therefore
          not be refreshed from a timer.
Solution: Also mark the ruler for redrawing when the last window has no
          status line and 'ruler' is set.  Update the documentation and
          add a test.

related: https://groups.google.com/g/vim_use/c/VKCL2bH8xlk


Currently, this is possible with the following setting, but it only updates the status line of the current window when windows are split, and above all, it is not intuitive:

set ruler
set rulerformat=%55(%{strftime('%H:%M:%S')}\ %5l,%-6(%c%V%)\ %P%)
call timer_start(1000, {-> feedkeys("\<Ignore>", 'n')}, {'repeat': -1})

After applying this PR, it would be better to write the third line as follows:

call timer_start(1000, {-> execute(':redrawstatus!')}, {'repeat': -1})

Notes

The screen dumps of Test_aa_terminal_focus_events had to be updated: they
recorded the ruler as "0,0-1" although the FocusLost/FocusGained
autocommands had already changed the buffer, so the ruler was stale. It
now shows "1,1", which is what a window with a status line showed all
along.

@h-east h-east changed the title :redrawstatus does not update the ruler in the last line :redrawstatus does not update the ruler in the last window Jul 29, 2026
Problem:  When the last window has no status line the ruler takes its
          place in the last screen line, but ":redrawstatus" and
          re-setting 'rulerformat' or 'statusline' do not update it
          there.  An item such as a clock in 'rulerformat' can therefore
          not be refreshed from a timer.
Solution: Also mark the ruler for redrawing when the last window has no
          status line and 'ruler' is set.  Update the documentation and
          add a test.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@h-east
h-east force-pushed the redrawstatus-ruler-lastwin branch from 15dd324 to 282d5bc Compare July 29, 2026 08:24
The ruler in the last screen line was not updated when the FocusLost and
FocusGained autocommands changed the buffer, so the dumps recorded the
stale "0,0-1".  With the ruler being redrawn it now shows "1,1", which is
what a window with a status line already showed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant