From eaf8e57cf9edbc8bce9884f427928bb8bb9bb315 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 22 Aug 2018 13:00:42 -0400 Subject: vim-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) https://github.com/vim/vim/commit/ffd99f729bd806e09d9355ede9c17780b61057bf --- src/nvim/testdir/test_ins_complete.vim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_ins_complete.vim b/src/nvim/testdir/test_ins_complete.vim index c307e33cbf..5ff63e58ba 100644 --- a/src/nvim/testdir/test_ins_complete.vim +++ b/src/nvim/testdir/test_ins_complete.vim @@ -217,3 +217,22 @@ function Test_CompleteDoneList() let s:called_completedone = 0 au! CompleteDone 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 -\\" + call assert_equal("\n-\nmatch 1 of 2", execute(':2mess')) + + bwipe! + delfunc Omni + set omnifunc= +endfunc -- cgit