diff src/testdir/test_ins_complete.vim @ 12728:9c1659761fc3 v8.0.1242

patch 8.0.1242: function argument with only dash is seen as number zero commit https://github.com/vim/vim/commit/ffd99f729bd806e09d9355ede9c17780b61057bf Author: Bram Moolenaar <Bram@vim.org> Date: Thu Nov 2 15:44:14 2017 +0100 patch 8.0.1242: function argument with only dash is seen as number zero Problem: Function argument with only dash is seen as number zero. (Wang Shidong) Solution: See a dash as a string. (Christian Brabandt)
author Christian Brabandt <cb@256bit.org>
date Thu, 02 Nov 2017 15:45:06 +0100
parents 03a6aeea2096
children cb9b2774f21f
line wrap: on
line diff
--- a/src/testdir/test_ins_complete.vim
+++ b/src/testdir/test_ins_complete.vim
@@ -90,3 +90,22 @@ func Test_ins_complete()
   call delete('Xtestdata')
   set cpt& cot& def& tags& tagbsearch& hidden&
 endfunc
+
+func Test_omni_dash()
+  func Omni(findstart, base)
+    if a:findstart
+        return 5
+    else
+        echom a:base
+	return ['-help', '-v']
+    endif
+  endfunc
+  set omnifunc=Omni
+  new
+  exe "normal Gofind -\<C-x>\<C-o>"
+  call assert_equal("\n-\nmatch 1 of 2", execute(':2mess'))
+
+  bwipe!
+  delfunc Omni
+  set omnifunc=
+endfunc