aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/drawscreen.c2
-rw-r--r--src/nvim/optionstr.c1
-rw-r--r--test/old/testdir/test_messages.vim6
3 files changed, 7 insertions, 2 deletions
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c
index ea6be5d6d3..1626e46cf6 100644
--- a/src/nvim/drawscreen.c
+++ b/src/nvim/drawscreen.c
@@ -1178,7 +1178,7 @@ void comp_col(void)
sc_col = ru_col;
}
}
- if (p_sc) {
+ if (p_sc && *p_sloc == 'l') {
sc_col += SHOWCMD_COLS;
if (!p_ru || last_has_status) { // no need for separating space
sc_col++;
diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c
index 518208a037..8ee81e4d4e 100644
--- a/src/nvim/optionstr.c
+++ b/src/nvim/optionstr.c
@@ -2100,6 +2100,7 @@ const char *did_set_showbreak(optset_T *args)
/// The 'showcmdloc' option is changed.
const char *did_set_showcmdloc(optset_T *args FUNC_ATTR_UNUSED)
{
+ comp_col();
return did_set_opt_strings(p_sloc, p_sloc_values, true);
}
diff --git a/test/old/testdir/test_messages.vim b/test/old/testdir/test_messages.vim
index 5ebcb375b6..5979e35327 100644
--- a/test/old/testdir/test_messages.vim
+++ b/test/old/testdir/test_messages.vim
@@ -167,8 +167,12 @@ func Test_echospace()
call assert_equal(&columns - 12, v:echospace)
set showcmd ruler
call assert_equal(&columns - 29, v:echospace)
+ set showcmdloc=statusline
+ call assert_equal(&columns - 19, v:echospace)
+ set showcmdloc=tabline
+ call assert_equal(&columns - 19, v:echospace)
- set ruler& showcmd&
+ set ruler& showcmd& showcmdloc&
endfunc
func Test_warning_scroll()