diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2022-12-15 13:15:39 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-12-15 13:15:39 +0000 |
commit | ba936f6f4e85cc1408bc3967f9fd7665d948909b (patch) | |
tree | 5c3d87dd658a5c5de01db33af82103dbb96714cc /src/drawscreen.c | |
parent | 3d473ee1a6aed7cb9eae458bbd8d42dffdc754f9 (diff) |
patch 9.0.1061: cannot display 'showcmd' somewhere elsev9.0.1061
Problem: Cannot display 'showcmd' somewhere else.
Solution: Add the 'showcmdloc' option. (Luuk van Baal, closes #11684)
Diffstat (limited to 'src/drawscreen.c')
-rw-r--r-- | src/drawscreen.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/drawscreen.c b/src/drawscreen.c index 77828089c2..13892bb7ca 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -73,8 +73,6 @@ static void redraw_custom_statusline(win_T *wp); static int did_update_one_window; #endif -static void win_redr_status(win_T *wp, int ignore_pum); - /* * Based on the current value of curwin->w_topline, transfer a screenfull * of stuff from Filemem to ScreenLines[], and update curwin->w_botline. @@ -423,7 +421,7 @@ statusline_row(win_T *wp) * If "ignore_pum" is TRUE, also redraw statusline when the popup menu is * displayed. */ - static void + void win_redr_status(win_T *wp, int ignore_pum UNUSED) { int row; @@ -548,6 +546,16 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) - 1 + wp->w_wincol), attr); win_redr_ruler(wp, TRUE, ignore_pum); + + // Draw the 'showcmd' information if 'showcmdloc' == "statusline". + if (p_sc && *p_sloc == 's') + { + int width = MIN(10, this_ru_col - len - 2); + + if (width > 0) + screen_puts_len(showcmd_buf, width, row, + wp->w_wincol + this_ru_col - width - 1, attr); + } } /* |