aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/optionstr.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-03-02 06:48:11 +0800
committerGitHub <noreply@github.com>2024-03-02 06:48:11 +0800
commit62d04f21d9eb16f8fca2ed5038c7af4fa3f8c63a (patch)
tree684afb3d3688f0c4c58f2456a2130f949cdc78c7 /src/nvim/optionstr.c
parent1fe65b3457d2e0632831445899d6d8a4bff9daee (diff)
downloadrneovim-62d04f21d9eb16f8fca2ed5038c7af4fa3f8c63a.tar.gz
rneovim-62d04f21d9eb16f8fca2ed5038c7af4fa3f8c63a.tar.bz2
rneovim-62d04f21d9eb16f8fca2ed5038c7af4fa3f8c63a.zip
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 https://github.com/vim/vim/commit/c27fcf4857228bc650943246ffbba444a085b3e7
Diffstat (limited to 'src/nvim/optionstr.c')
-rw-r--r--src/nvim/optionstr.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c
index 8ee81e4d4e..4be08b28f5 100644
--- a/src/nvim/optionstr.c
+++ b/src/nvim/optionstr.c
@@ -2100,8 +2100,13 @@ 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);
+ const char *errmsg = did_set_opt_strings(p_sloc, p_sloc_values, false);
+
+ if (errmsg == NULL) {
+ comp_col();
+ }
+
+ return errmsg;
}
int expand_set_showcmdloc(optexpand_T *args, int *numMatches, char ***matches)