mirror of
https://github.com/neovim/neovim.git
synced 2025-09-08 04:18:18 +00:00
vim-patch:9.1.0146: v:echospace wrong with invalid value of 'showcmdloc' (#27697)
Problem: v:echospace wrong after setting invalid value to 'showcmdloc'.
Solution: Only call comp_col() if value is valid.
(zeertzjq)
closes: vim/vim#14119
c27fcf4857
This commit is contained in:
@@ -2100,8 +2100,13 @@ const char *did_set_showbreak(optset_T *args)
|
|||||||
/// The 'showcmdloc' option is changed.
|
/// The 'showcmdloc' option is changed.
|
||||||
const char *did_set_showcmdloc(optset_T *args FUNC_ATTR_UNUSED)
|
const char *did_set_showcmdloc(optset_T *args FUNC_ATTR_UNUSED)
|
||||||
{
|
{
|
||||||
comp_col();
|
const char *errmsg = did_set_opt_strings(p_sloc, p_sloc_values, false);
|
||||||
return did_set_opt_strings(p_sloc, p_sloc_values, true);
|
|
||||||
|
if (errmsg == NULL) {
|
||||||
|
comp_col();
|
||||||
|
}
|
||||||
|
|
||||||
|
return errmsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
int expand_set_showcmdloc(optexpand_T *args, int *numMatches, char ***matches)
|
int expand_set_showcmdloc(optexpand_T *args, int *numMatches, char ***matches)
|
||||||
|
@@ -171,6 +171,12 @@ func Test_echospace()
|
|||||||
call assert_equal(&columns - 19, v:echospace)
|
call assert_equal(&columns - 19, v:echospace)
|
||||||
set showcmdloc=tabline
|
set showcmdloc=tabline
|
||||||
call assert_equal(&columns - 19, v:echospace)
|
call assert_equal(&columns - 19, v:echospace)
|
||||||
|
call assert_fails('set showcmdloc=leap', 'E474:')
|
||||||
|
call assert_equal(&columns - 19, v:echospace)
|
||||||
|
set showcmdloc=last
|
||||||
|
call assert_equal(&columns - 29, v:echospace)
|
||||||
|
call assert_fails('set showcmdloc=jump', 'E474:')
|
||||||
|
call assert_equal(&columns - 29, v:echospace)
|
||||||
|
|
||||||
set ruler& showcmd& showcmdloc&
|
set ruler& showcmd& showcmdloc&
|
||||||
endfunc
|
endfunc
|
||||||
|
Reference in New Issue
Block a user