aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2018-08-23 10:48:06 -0400
committerGitHub <noreply@github.com>2018-08-23 10:48:06 -0400
commita5d00527a1f8159f6efae3b75c502ec85d9f2158 (patch)
treea27d04e6c2742a0d2e6ed5680a38ba4c6d3d108a /src
parentdfbb75fdabe3829abd0a1f0f905adc7dc5740d15 (diff)
parenteaf8e57cf9edbc8bce9884f427928bb8bb9bb315 (diff)
downloadrneovim-a5d00527a1f8159f6efae3b75c502ec85d9f2158.tar.gz
rneovim-a5d00527a1f8159f6efae3b75c502ec85d9f2158.tar.bz2
rneovim-a5d00527a1f8159f6efae3b75c502ec85d9f2158.zip
Merge pull request #8887 from janlazo/vim-8.0.1242
[RDY] vim-patch:8.0.1242
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.c6
-rw-r--r--src/nvim/testdir/test_ins_complete.vim19
2 files changed, 24 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 4bb7a45232..8db8aaa168 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -1210,8 +1210,12 @@ int call_vim_function(
if (str_arg_only) {
len = 0;
} else {
- // Recognize a number argument, the others must be strings.
+ // Recognize a number argument, the others must be strings. A dash
+ // is a string too.
vim_str2nr(argv[i], NULL, &len, STR2NR_ALL, &n, NULL, 0);
+ if (len == 1 && *argv[i] == '-') {
+ len = 0;
+ }
}
if (len != 0 && len == (int)STRLEN(argv[i])) {
argvars[i].v_type = VAR_NUMBER;
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 -\<C-x>\<C-o>"
+ call assert_equal("\n-\nmatch 1 of 2", execute(':2mess'))
+
+ bwipe!
+ delfunc Omni
+ set omnifunc=
+endfunc