From: shane.xb.qian Date: Wed, 15 Mar 2023 15:08:25 +0000 (+0800) Subject: fix: using stridx with tolower instead X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=3ac4322c8cfb2f95a7420faef2d8a55103670614;p=vim-lsp.git fix: using stridx with tolower instead Signed-off-by: shane.xb.qian --- diff --git a/autoload/lsp/completion.vim b/autoload/lsp/completion.vim index d0d2451..5c5e146 100644 --- a/autoload/lsp/completion.vim +++ b/autoload/lsp/completion.vim @@ -88,7 +88,7 @@ export def CompletionReply(lspserver: dict, 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> = [] for item in items @@ -107,7 +107,7 @@ export def CompletionReply(lspserver: dict, 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