]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Use method calling syntax
authorYegappan Lakshmanan <yegappan@yahoo.com>
Sun, 28 May 2023 19:50:26 +0000 (12:50 -0700)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Sun, 28 May 2023 19:50:26 +0000 (12:50 -0700)
autoload/lsp/codeaction.vim
autoload/lsp/completion.vim

index 2c1680e0cd84fff79b3f298e8b7c2aa2abd4d80b..3f103e7641ff36092c49beed5f95fec477e91699 100644 (file)
@@ -83,7 +83,7 @@ export def ApplyCodeAction(lspserver: dict<any>, actionlist: list<dict<any>>, qu
   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
index f2e706f99f937736e8a3295859bf847c37d09d8b..643ea997e0241f3abd0f80a0858e24356f68bf3f 100644 (file)
@@ -117,7 +117,7 @@ def CompletionUltiSnips(prefix: string, items: list<dict<any>>)
   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"