autoload/lsp/codeaction.vim | 2 +- autoload/lsp/completion.vim | 2 +- diff --git a/autoload/lsp/codeaction.vim b/autoload/lsp/codeaction.vim index 2c1680e0cd84fff79b3f298e8b7c2aa2abd4d80b..3f103e7641ff36092c49beed5f95fec477e91699 100644 --- a/autoload/lsp/codeaction.vim +++ b/autoload/lsp/codeaction.vim @@ -83,7 +83,7 @@ var choice: number if query =~ '^\d\+' # digit - choice = str2nr(query) + choice = query->str2nr() elseif query =~ '^/' # regex choice = 1 + util.Indexof(actions, (i, a) => a.title =~ query[1 : ]) elseif query != '' # literal string diff --git a/autoload/lsp/completion.vim b/autoload/lsp/completion.vim index f2e706f99f937736e8a3295859bf847c37d09d8b..643ea997e0241f3abd0f80a0858e24356f68bf3f 100644 --- a/autoload/lsp/completion.vim +++ b/autoload/lsp/completion.vim @@ -117,7 +117,7 @@ call UltiSnips#SnippetsInCurrentScope(1) for key in matchfuzzy(g:current_ulti_dict_info->keys(), prefix) var item = g:current_ulti_dict_info[key] var parts = split(item.location, ':') - var txt = readfile(parts[0])[str2nr(parts[1]) : str2nr(parts[1]) + 20] + var txt = parts[0]->readfile()[parts[1]->str2nr() : parts[1]->str2nr() + 20] var restxt = item.description .. "\n\n" for line in txt if line == "" || line[0 : 6] == "snippet"