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:
zeertzjq
2024-03-02 06:48:11 +08:00
committed by GitHub
parent 1fe65b3457
commit 62d04f21d9
2 changed files with 13 additions and 2 deletions

View File

@@ -171,6 +171,12 @@ func Test_echospace()
call assert_equal(&columns - 19, v:echospace)
set showcmdloc=tabline
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&
endfunc