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)
diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim
index bdad26a..d25267f 100644
--- a/src/testdir/test_ins_complete.vim
+++ b/src/testdir/test_ins_complete.vim
@@ -90,3 +90,22 @@
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