From ba936f6f4e85cc1408bc3967f9fd7665d948909b Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Thu, 15 Dec 2022 13:15:39 +0000 Subject: patch 9.0.1061: cannot display 'showcmd' somewhere else Problem: Cannot display 'showcmd' somewhere else. Solution: Add the 'showcmdloc' option. (Luuk van Baal, closes #11684) --- src/drawscreen.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/drawscreen.c') 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); + } } /* -- cgit v1.2.3