diff src/testdir/test_options.vim @ 30417:6a1862bfb280 v9.0.0544

patch 9.0.0544: minor issues with setting a string option Commit: https://github.com/vim/vim/commit/fcba86c0316dc0d6341078b50e7967206a1627a0 Author: zeertzjq <zeertzjq@outlook.com> Date: Thu Sep 22 13:57:32 2022 +0100 patch 9.0.0544: minor issues with setting a string option Problem: Minor issues with setting a string option. Solution: Adjust the code, add a test. (closes https://github.com/vim/vim/issues/11192)
author Bram Moolenaar <Bram@vim.org>
date Thu, 22 Sep 2022 15:00:05 +0200
parents 56e38195570b
children 457ea0570b6f
line wrap: on
line diff
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -1343,4 +1343,18 @@ func Test_switchbuf_reset()
   only!
 endfunc
 
+" :set empty string for global 'keywordprg' falls back to ":help"
+func Test_keywordprg_empty()
+  let k = &keywordprg
+  set keywordprg=man
+  call assert_equal('man', &keywordprg)
+  set keywordprg=
+  call assert_equal(':help', &keywordprg)
+  set keywordprg=man
+  call assert_equal('man', &keywordprg)
+  call assert_equal("\n  keywordprg=:help", execute('set kp= kp?'))
+  let &keywordprg = k
+endfunc
+
+
 " vim: shiftwidth=2 sts=2 expandtab