- Fixed search().
This commit is contained in:
parent
2923db87ab
commit
f24fff3c60
@ -660,9 +660,9 @@ function! s:get_snippet_range(begin_line, begin_patterns, end_line, end_patterns
|
|||||||
if empty(a:begin_patterns)
|
if empty(a:begin_patterns)
|
||||||
let begin = line('.') - 50
|
let begin = line('.') - 50
|
||||||
else
|
else
|
||||||
let begin = search(neocomplcache#util#escape_pattern(
|
let [begin, _] = searchpos('^' . neocomplcache#util#escape_pattern(
|
||||||
\ a:begin_patterns[0]), 'bnW')
|
\ a:begin_patterns[0]) . '$', 'bnW')
|
||||||
if begin < 0
|
if begin <= 0
|
||||||
let begin = line('.') - 50
|
let begin = line('.') - 50
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -674,9 +674,9 @@ function! s:get_snippet_range(begin_line, begin_patterns, end_line, end_patterns
|
|||||||
if empty(a:end_patterns)
|
if empty(a:end_patterns)
|
||||||
let end = line('.') + 50
|
let end = line('.') + 50
|
||||||
else
|
else
|
||||||
let end = search(neocomplcache#util#escape_pattern(
|
let [end, _] = searchpos('^' . neocomplcache#util#escape_pattern(
|
||||||
\ a:end_patterns[0]), 'nW')
|
\ a:end_patterns[0]) . '$', 'nW')
|
||||||
if end < 0
|
if end <= 0
|
||||||
let end = line('.') + 50
|
let end = line('.') + 50
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user