ingo#search#buffer#IsKeywordMatch(): FIX: Existing clients actually pass pattern, not literal text

This commit is contained in:
Ingo Karkat
2019-10-25 15:44:34 +02:00
parent 5a4f44ec7b
commit 1535cc83e2
+3 -3
View File
@@ -2,7 +2,7 @@
"
" DEPENDENCIES:
"
" Copyright: (C) 2013 Ingo Karkat
" Copyright: (C) 2013-2019 Ingo Karkat
" The VIM LICENSE applies to this script; see ':help copyright'.
"
" Maintainer: Ingo Karkat <ingo@karkat.de>
@@ -10,9 +10,9 @@
" REVISION DATE REMARKS
" 1.005.001 10-Apr-2013 file creation
function! ingo#search#buffer#IsKeywordMatch( text, startVirtCol )
function! ingo#search#buffer#IsKeywordMatch( pattern, startVirtCol )
return search(
\ printf('\C\V\%%%dv\<%s\>', a:startVirtCol, escape(a:text, '\')),
\ printf('\%%%dv\<%s\>', a:startVirtCol, a:pattern),
\ 'cnW', line('.')
\)
endfunction