From 3ac4322c8cfb2f95a7420faef2d8a55103670614 Mon Sep 17 00:00:00 2001 From: "shane.xb.qian" Date: Wed, 15 Mar 2023 23:08:25 +0800 Subject: [PATCH] fix: using stridx with tolower instead Signed-off-by: shane.xb.qian --- autoload/lsp/completion.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.48.1