]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
fix: using stridx with tolower instead
authorshane.xb.qian <shane.qian@foxmail.com>
Wed, 15 Mar 2023 15:08:25 +0000 (23:08 +0800)
committershane.xb.qian <shane.qian@foxmail.com>
Wed, 15 Mar 2023 15:08:25 +0000 (23:08 +0800)
Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
autoload/lsp/completion.vim

index d0d24513fb9b9b1cbe7fafc59254e9fcb2e9585e..5c5e1461557913b6d1504fadc48ab31ec8007345 100644 (file)
@@ -88,7 +88,7 @@ export def CompletionReply(lspserver: dict<any>, cItems: any)
   # Get the keyword prefix before the current cursor column.
   var col = charcol('.')
   var starttext = getline('.')[ : col - 1]
-  var prefix = matchstr(starttext, '\k*$')
+  var prefix = tolower(matchstr(starttext, '\k*$'))
 
   var completeItems: list<dict<any>> = []
   for item in items
@@ -107,7 +107,7 @@ export def CompletionReply(lspserver: dict<any>, cItems: any)
     else
       # plain text completion.  If the completion item text doesn't start with
       # the current (case ignored) keyword prefix, skip it.
-      if prefix != '' && d.word !~? $'^{prefix}'
+      if prefix != '' && stridx(tolower(d.word), prefix) != 0
        continue
       endif
     endif