diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-10-12 13:51:18 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-12 13:51:18 -0400 |
| commit | e7cd0e4375a48d32eea6776d6d26e92eed9fedbe (patch) | |
| tree | 1a0e4614ea9965914769a632c59a85cc264f74dc /src | |
| parent | 2323746bfe4af534979249b051e7ada11c63b389 (diff) | |
| download | rneovim-e7cd0e4375a48d32eea6776d6d26e92eed9fedbe.tar.gz rneovim-e7cd0e4375a48d32eea6776d6d26e92eed9fedbe.tar.bz2 rneovim-e7cd0e4375a48d32eea6776d6d26e92eed9fedbe.zip | |
fix(ui): ext_messages/ui2: stale 'rulerformat' "[+]" after :write #42315
Problem:
With 'ruler' in the cmdline ('laststatus=0') and ext_messages (ui2), a
'rulerformat' "%m" does not update the "[+]" indicator after ":write",
until a cursor-move.
Analysis:
`redraw_buf_status_later()` only marks windows with a statusline or
winbar. The symptom is hidden by the legacy message grid because the
write message overwrites the cmdline, which redraws the ruler.
Solution:
Also mark the cmdline 'ruler', like `status_redraw_buf()`.
Diffstat (limited to 'src')
| -rw-r--r-- | src/nvim/drawscreen.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c index e376a4d135..eb4a1a3fd8 100644 --- a/src/nvim/drawscreen.c +++ b/src/nvim/drawscreen.c @@ -2741,7 +2741,7 @@ void redraw_buf_range_later(buf_T *buf, linenr_T first, linenr_T last) } } -/// called when the status bars for the buffer 'buf' need to be updated +/// Marks the statuslines, 'winbar' and cmdline ruler of `buf` for redraw. void redraw_buf_status_later(buf_T *buf) { FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { @@ -2753,6 +2753,10 @@ void redraw_buf_status_later(buf_T *buf) set_must_redraw(UPD_VALID); } } + // Redraw 'ruler' if it is in cmdline (e.g. 'laststatus=0') and was not marked for redraw above. + if (p_ru && curwin->w_buffer == buf && !curwin->w_status_height && !curwin->w_redr_status) { + redraw_cmdline = true; + } } /// Mark all status lines and window bars for redraw; used after first :cd @@ -2787,7 +2791,7 @@ void status_redraw_buf(buf_T *buf) redraw_later(wp, UPD_VALID); } } - // Redraw the ruler if it is in the command line and was not marked for redraw above + // Redraw 'ruler' if it is in cmdline (e.g. 'laststatus=0') and was not marked for redraw above. if (p_ru && !curwin->w_status_height && !curwin->w_redr_status) { redraw_cmdline = true; redraw_later(curwin, UPD_VALID); |