- Fixed snippet range error.
This commit is contained in:
parent
a0bff2e441
commit
7d33bf8058
@ -655,6 +655,9 @@ function! s:get_snippet_range(start_patterns, end_patterns)"{{{
|
|||||||
else
|
else
|
||||||
let start = search(neocomplcache#util#escape_pattern(
|
let start = search(neocomplcache#util#escape_pattern(
|
||||||
\ a:start_patterns[0]), 'bnW')
|
\ a:start_patterns[0]), 'bnW')
|
||||||
|
if start < 0
|
||||||
|
let start = line('.') - 50
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
if start <= 0
|
if start <= 0
|
||||||
let start = 1
|
let start = 1
|
||||||
@ -665,6 +668,9 @@ function! s:get_snippet_range(start_patterns, end_patterns)"{{{
|
|||||||
else
|
else
|
||||||
let end = search(neocomplcache#util#escape_pattern(
|
let end = search(neocomplcache#util#escape_pattern(
|
||||||
\ a:end_patterns[0]), 'nW')
|
\ a:end_patterns[0]), 'nW')
|
||||||
|
if end < 0
|
||||||
|
let end = line('.') + 50
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
if end > line('$')
|
if end > line('$')
|
||||||
let end = line('$')
|
let end = line('$')
|
||||||
@ -766,7 +772,7 @@ function! s:search_sync_placeholder(start, end, number)"{{{
|
|||||||
\ substitute(s:get_placeholder_marker_pattern(),
|
\ substitute(s:get_placeholder_marker_pattern(),
|
||||||
\ '\\d\\+', '\\zs\\d\\+\\ze', ''))
|
\ '\\d\\+', '\\zs\\d\\+\\ze', ''))
|
||||||
return search(substitute(
|
return search(substitute(
|
||||||
\ s:get_mirror_placeholder_marker_pattern(),
|
\ s:get_mirror_placeholder_marker_pattern()
|
||||||
\ '\\d\\+', cnt, ''), 'nw') > 0 ? cnt : 0
|
\ '\\d\\+', cnt, ''), 'nw') > 0 ? cnt : 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user