- Improved options word behavior.
This commit is contained in:
@@ -435,15 +435,21 @@ function! s:is_beginning_of_line(cur_text)"{{{
|
||||
return prev_word_end <= 0
|
||||
endfunction"}}}
|
||||
function! s:get_cursor_snippet(snippets, cur_text)"{{{
|
||||
let cur_word = matchstr(a:cur_text, '\w\+$')
|
||||
if cur_word != '' &&
|
||||
\ has_key(a:snippets, cur_word) && a:snippets[cur_word].options.word
|
||||
return cur_word
|
||||
let cur_word = matchstr(a:cur_text, '\S\+$')
|
||||
if cur_word != '' && has_key(a:snippets, cur_word)
|
||||
return cur_word
|
||||
endif
|
||||
|
||||
let cur_word = matchstr(a:cur_text, '\S\+$')
|
||||
while cur_word != ''
|
||||
if has_key(a:snippets, cur_word) &&
|
||||
\ a:snippets[cur_word].options.word
|
||||
return cur_word
|
||||
endif
|
||||
|
||||
return cur_word != '' && has_key(a:snippets, cur_word) ? cur_word : ''
|
||||
let cur_word = substitute(cur_word, '^\%(\w\+\|\W\)', '', '')
|
||||
endwhile
|
||||
|
||||
return cur_word
|
||||
endfunction"}}}
|
||||
function! s:snippets_expand(cur_text, col)"{{{
|
||||
let cur_word = s:get_cursor_snippet(
|
||||
|
||||
Reference in New Issue
Block a user