Merge pull request #8887 from janlazo/vim-8.0.1242

[RDY] vim-patch:8.0.1242
This commit is contained in:
James McCoy 2018-08-23 10:48:06 -04:00 committed by GitHub
commit a5d00527a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 1 deletions

View File

@ -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;

View File

@ -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