aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/drawscreen.c
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2023-04-10 21:40:35 +0100
committerSean Dewar <seandewar@users.noreply.github.com>2023-04-17 18:40:12 +0100
commit65dd3c1180cef5ec15a46bd278ab3a0cb1c3460d (patch)
tree1f79c931e3eaa40dd127d3aad1cd9e2462414e10 /src/nvim/drawscreen.c
parent7095f8ff9d9ce3519abe34a3da4c8f4bdc3fc865 (diff)
downloadrneovim-65dd3c1180cef5ec15a46bd278ab3a0cb1c3460d.tar.gz
rneovim-65dd3c1180cef5ec15a46bd278ab3a0cb1c3460d.tar.bz2
rneovim-65dd3c1180cef5ec15a46bd278ab3a0cb1c3460d.zip
fix(ruler): show ruler of curwin with no statusline in cmdline
Problem: After neovim/neovim@846a056, only the ruler for current floating or last window without a statusline is drawn in the cmdline. This means that if the current window is not one of these, but has no statusline, its ruler will not be drawn anymore. Solution: Make `showmode()` draw the ruler of the current window or the last window in the cmdline if it has no statusline. This also maintains the previously restored floating window case (`float->w_status_height` should be 0). This behaviour should again match Vim, but without the overdraw it seems to do to achieve the same effect; it calls `showmode()` to draw the ruler for the last window without a statusline, then may draw over it in `showruler()` (which is now `show_cursor_info_later()` in Nvim) to show the ruler for the current window..? It's very confusing. Also update the logic in `win_redr_ruler()` to mirror the check done in `showmode()`, so that the ruler doesn't potentially draw over the long ins-completion mode message in some cases.
Diffstat (limited to 'src/nvim/drawscreen.c')
-rw-r--r--src/nvim/drawscreen.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c
index 5ced55b2c7..810175aeba 100644
--- a/src/nvim/drawscreen.c
+++ b/src/nvim/drawscreen.c
@@ -1052,11 +1052,11 @@ int showmode(void)
clear_showcmd();
}
- // If the last window has no status line and global statusline is disabled,
+ // If the current or last window has no status line and global statusline is disabled,
// the ruler is after the mode message and must be redrawn
- win_T *last = curwin->w_floating ? curwin : lastwin_nofloating();
- if (redrawing() && last->w_status_height == 0 && global_stl_height() == 0) {
- win_redr_ruler(last);
+ win_T *ruler_win = curwin->w_status_height == 0 ? curwin : lastwin_nofloating();
+ if (redrawing() && ruler_win->w_status_height == 0 && global_stl_height() == 0) {
+ win_redr_ruler(ruler_win);
}
redraw_cmdline = false;