Permalink
Browse files

Add abort flag

  • Loading branch information...
1 parent 232d2e8 commit 644b551aff6bc2be68a36307768b276f470c81e9 @Shougo committed Feb 8, 2016
@@ -33,15 +33,15 @@ let s:source = {
\ g:neocomplcache_auto_completion_start_length,
\}
-function! s:source.initialize() "{{{
+function! s:source.initialize() abort "{{{
" Initialize.
call neocomplcache#set_dictionary_helper(
\ g:neocomplcache_source_rank, 'snippets_complete', 8)
call neocomplcache#set_completion_length('snippets_complete',
\ g:neocomplcache_auto_completion_start_length)
endfunction"}}}
-function! s:source.get_keyword_pos(cur_text) "{{{
+function! s:source.get_keyword_pos(cur_text) abort "{{{
let cur_word = matchstr(a:cur_text, '\w\+$')
let word_candidates = neocomplcache#keyword_filter(
\ filter(values(neosnippet#helpers#get_snippets()),
@@ -53,7 +53,7 @@ function! s:source.get_keyword_pos(cur_text) "{{{
return match(a:cur_text, '\S\+$')
endfunction"}}}
-function! s:source.get_complete_words(cur_keyword_pos, cur_keyword_str) "{{{
+function! s:source.get_complete_words(cur_keyword_pos, cur_keyword_str) abort "{{{
let list = s:keyword_filter(neosnippet#helpers#get_snippets(), a:cur_keyword_str)
for snippet in list
@@ -66,7 +66,7 @@ function! s:source.get_complete_words(cur_keyword_pos, cur_keyword_str) "{{{
return list
endfunction"}}}
-function! s:keyword_filter(snippets, cur_keyword_str) "{{{
+function! s:keyword_filter(snippets, cur_keyword_str) abort "{{{
" Uniq by real_name.
let dict = {}
@@ -89,7 +89,7 @@ function! s:keyword_filter(snippets, cur_keyword_str) "{{{
return values(dict)
endfunction"}}}
-function! neocomplcache#sources#snippets_complete#define() "{{{
+function! neocomplcache#sources#snippets_complete#define() abort "{{{
return s:source
endfunction"}}}
@@ -37,7 +37,7 @@ let s:source = {
\ ['matcher_fuzzy'] : ['matcher_head']),
\}
-function! s:source.gather_candidates(context) "{{{
+function! s:source.gather_candidates(context) abort "{{{
let snippets = values(neosnippet#helpers#get_completion_snippets())
if matchstr(a:context.input, '\S\+$') !=#
\ matchstr(a:context.input, '\w\+$')
@@ -47,7 +47,7 @@ function! s:source.gather_candidates(context) "{{{
return snippets
endfunction"}}}
-function! s:source.hooks.on_post_filter(context) "{{{
+function! s:source.hooks.on_post_filter(context) abort "{{{
for snippet in a:context.candidates
let snippet.dup = 1
let snippet.menu = neosnippet#util#strwidthpart(
@@ -57,7 +57,7 @@ function! s:source.hooks.on_post_filter(context) "{{{
return a:context.candidates
endfunction"}}}
-function! neocomplete#sources#neosnippet#define() "{{{
+function! neocomplete#sources#neosnippet#define() abort "{{{
return s:source
endfunction"}}}
@@ -53,61 +53,61 @@ call neosnippet#util#set_default(
\ {'_':{ '(' : ')', '{' : '}', '"' : '"', '[' : ']' }})
"}}}
-function! neosnippet#expandable_or_jumpable() "{{{
+function! neosnippet#expandable_or_jumpable() abort "{{{
return neosnippet#mappings#expandable_or_jumpable()
endfunction"}}}
-function! neosnippet#expandable() "{{{
+function! neosnippet#expandable() abort "{{{
return neosnippet#mappings#expandable()
endfunction"}}}
-function! neosnippet#jumpable() "{{{
+function! neosnippet#jumpable() abort "{{{
return neosnippet#mappings#jumpable()
endfunction"}}}
-function! neosnippet#anonymous(snippet) "{{{
+function! neosnippet#anonymous(snippet) abort "{{{
return neosnippet#mappings#_anonymous(a:snippet)
endfunction"}}}
-function! neosnippet#expand(trigger) "{{{
+function! neosnippet#expand(trigger) abort "{{{
return neosnippet#mappings#_expand(a:trigger)
endfunction"}}}
-function! neosnippet#get_snippets_directory() "{{{
+function! neosnippet#get_snippets_directory() abort "{{{
return neosnippet#helpers#get_snippets_directory()
endfunction"}}}
-function! neosnippet#get_user_snippets_directory() "{{{
+function! neosnippet#get_user_snippets_directory() abort "{{{
return copy(neosnippet#variables#snippets_dir())
endfunction"}}}
-function! neosnippet#get_runtime_snippets_directory() "{{{
+function! neosnippet#get_runtime_snippets_directory() abort "{{{
return copy(neosnippet#variables#runtime_dir())
endfunction"}}}
" Get marker patterns.
-function! neosnippet#get_placeholder_target_marker_pattern() "{{{
+function! neosnippet#get_placeholder_target_marker_pattern() abort "{{{
return '\${\d\+:\(#:\)\?TARGET\%(:.\{-}\)\?\\\@<!}'
endfunction"}}}
-function! neosnippet#get_placeholder_marker_pattern() "{{{
+function! neosnippet#get_placeholder_marker_pattern() abort "{{{
return '<`\d\+\%(:.\{-}\)\?\\\@<!`>'
endfunction"}}}
-function! neosnippet#get_placeholder_marker_substitute_pattern() "{{{
+function! neosnippet#get_placeholder_marker_substitute_pattern() abort "{{{
return '\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}'
endfunction"}}}
-function! neosnippet#get_placeholder_marker_substitute_nonzero_pattern() "{{{
+function! neosnippet#get_placeholder_marker_substitute_nonzero_pattern() abort "{{{
return '\${\([1-9]\d*\%(:.\{-}\)\?\\\@<!\)}'
endfunction"}}}
-function! neosnippet#get_placeholder_marker_substitute_zero_pattern() "{{{
+function! neosnippet#get_placeholder_marker_substitute_zero_pattern() abort "{{{
return '\${\(0\%(:.\{-}\)\?\\\@<!\)}'
endfunction"}}}
-function! neosnippet#get_placeholder_marker_default_pattern() "{{{
+function! neosnippet#get_placeholder_marker_default_pattern() abort "{{{
return '<`\d\+:\zs.\{-}\ze\\\@<!`>'
endfunction"}}}
-function! neosnippet#get_sync_placeholder_marker_pattern() "{{{
+function! neosnippet#get_sync_placeholder_marker_pattern() abort "{{{
return '<{\d\+\%(:.\{-}\)\?\\\@<!}>'
endfunction"}}}
-function! neosnippet#get_sync_placeholder_marker_default_pattern() "{{{
+function! neosnippet#get_sync_placeholder_marker_default_pattern() abort "{{{
return '<{\d\+:\zs.\{-}\ze\\\@<!}>'
endfunction"}}}
-function! neosnippet#get_mirror_placeholder_marker_pattern() "{{{
+function! neosnippet#get_mirror_placeholder_marker_pattern() abort "{{{
return '<|\d\+|>'
endfunction"}}}
-function! neosnippet#get_mirror_placeholder_marker_substitute_pattern() "{{{
+function! neosnippet#get_mirror_placeholder_marker_substitute_pattern() abort "{{{
return '\$\(\d\+\)'
endfunction"}}}
@@ -34,14 +34,14 @@ let s:edit_options = [
let s:Cache = neosnippet#util#get_vital().import('System.Cache')
"}}}
-function! s:get_list() "{{{
+function! s:get_list() abort "{{{
if !exists('s:List')
let s:List = vital#of('neosnippet').import('Data.List')
endif
return s:List
endfunction"}}}
-function! neosnippet#commands#_edit(args) "{{{
+function! neosnippet#commands#_edit(args) abort "{{{
if neosnippet#util#is_sudo()
call neosnippet#util#print_error(
\ '"sudo vim" is detected. This feature is disabled.')
@@ -92,7 +92,7 @@ function! neosnippet#commands#_edit(args) "{{{
endtry
endfunction"}}}
-function! neosnippet#commands#_make_cache(filetype) "{{{
+function! neosnippet#commands#_make_cache(filetype) abort "{{{
call neosnippet#init#check()
let filetype = a:filetype == '' ?
@@ -128,15 +128,15 @@ function! neosnippet#commands#_make_cache(filetype) "{{{
endif
endfunction"}}}
-function! neosnippet#commands#_source(filename) "{{{
+function! neosnippet#commands#_source(filename) abort "{{{
call neosnippet#init#check()
let neosnippet = neosnippet#variables#current_neosnippet()
let neosnippet.snippets = extend(neosnippet.snippets,
\ neosnippet#parser#_parse_snippets(a:filename))
endfunction"}}}
-function! neosnippet#commands#_clear_markers() "{{{
+function! neosnippet#commands#_clear_markers() abort "{{{
let expand_stack = neosnippet#variables#expand_stack()
" Get patterns and count.
@@ -150,12 +150,12 @@ function! neosnippet#commands#_clear_markers() "{{{
endfunction"}}}
" Complete helpers.
-function! neosnippet#commands#_edit_complete(arglead, cmdline, cursorpos) "{{{
+function! neosnippet#commands#_edit_complete(arglead, cmdline, cursorpos) abort "{{{
return filter(s:edit_options +
\ neosnippet#commands#_filetype_complete(a:arglead, a:cmdline, a:cursorpos),
\ 'stridx(v:val, a:arglead) == 0')
endfunction"}}}
-function! neosnippet#commands#_filetype_complete(arglead, cmdline, cursorpos) "{{{
+function! neosnippet#commands#_filetype_complete(arglead, cmdline, cursorpos) abort "{{{
" Dup check.
let ret = {}
for item in map(
@@ -170,13 +170,13 @@ function! neosnippet#commands#_filetype_complete(arglead, cmdline, cursorpos) "{
return sort(keys(ret))
endfunction"}}}
-function! neosnippet#commands#_complete_target_snippets(arglead, cmdline, cursorpos) "{{{
+function! neosnippet#commands#_complete_target_snippets(arglead, cmdline, cursorpos) abort "{{{
return map(filter(values(neosnippet#helpers#get_snippets()),
\ "stridx(v:val.word, a:arglead) == 0
\ && v:val.snip =~# neosnippet#get_placeholder_target_marker_pattern()"), 'v:val.word')
endfunction"}}}
-function! s:initialize_options(options) "{{{
+function! s:initialize_options(options) abort "{{{
let default_options = {
\ 'runtime' : 0,
\ 'vertical' : 0,
@@ -26,7 +26,7 @@
let s:save_cpo = &cpo
set cpo&vim
-function! neosnippet#handlers#_complete_done() "{{{
+function! neosnippet#handlers#_complete_done() abort "{{{
if empty(v:completed_item)
\ || !g:neosnippet#enable_completed_snippet
\ || s:is_auto_pairs()
@@ -43,7 +43,7 @@ function! neosnippet#handlers#_complete_done() "{{{
call neosnippet#view#_insert(snippet, {}, cur_text, col)
endfunction"}}}
-function! neosnippet#handlers#_cursor_moved() "{{{
+function! neosnippet#handlers#_cursor_moved() abort "{{{
let expand_stack = neosnippet#variables#expand_stack()
" Get patterns and count.
@@ -59,7 +59,7 @@ function! neosnippet#handlers#_cursor_moved() "{{{
endif
endfunction"}}}
-function! neosnippet#handlers#_all_clear_markers() "{{{
+function! neosnippet#handlers#_all_clear_markers() abort "{{{
let pos = getpos('.')
try
@@ -74,7 +74,7 @@ function! neosnippet#handlers#_all_clear_markers() "{{{
endtry
endfunction"}}}
-function! neosnippet#handlers#_restore_unnamed_register() "{{{
+function! neosnippet#handlers#_restore_unnamed_register() abort "{{{
let neosnippet = neosnippet#variables#current_neosnippet()
if neosnippet.unnamed_register != ''
@@ -26,7 +26,7 @@
let s:save_cpo = &cpo
set cpo&vim
-function! neosnippet#helpers#get_cursor_snippet(snippets, cur_text) "{{{
+function! neosnippet#helpers#get_cursor_snippet(snippets, cur_text) abort "{{{
let cur_word = matchstr(a:cur_text, '\S\+$')
if cur_word != '' && has_key(a:snippets, cur_word)
return cur_word
@@ -44,7 +44,7 @@ function! neosnippet#helpers#get_cursor_snippet(snippets, cur_text) "{{{
return cur_word
endfunction"}}}
-function! neosnippet#helpers#get_snippets() "{{{
+function! neosnippet#helpers#get_snippets() abort "{{{
call neosnippet#init#check()
let neosnippet = neosnippet#variables#current_neosnippet()
@@ -72,12 +72,12 @@ function! neosnippet#helpers#get_snippets() "{{{
return snippets
endfunction"}}}
-function! neosnippet#helpers#get_completion_snippets() "{{{
+function! neosnippet#helpers#get_completion_snippets() abort "{{{
return filter(neosnippet#helpers#get_snippets(),
\ "!get(v:val.options, 'oneshot', 0)")
endfunction"}}}
-function! neosnippet#helpers#get_snippets_directory() "{{{
+function! neosnippet#helpers#get_snippets_directory() abort "{{{
let snippets_dir = copy(neosnippet#variables#snippets_dir())
if !get(g:neosnippet#disable_runtime_snippets,
\ neosnippet#helpers#get_filetype(),
@@ -88,7 +88,7 @@ function! neosnippet#helpers#get_snippets_directory() "{{{
return snippets_dir
endfunction"}}}
-function! neosnippet#helpers#get_filetype() "{{{
+function! neosnippet#helpers#get_filetype() abort "{{{
if !exists('s:exists_context_filetype')
" context_filetype.vim installation check.
try
@@ -109,7 +109,7 @@ function! neosnippet#helpers#get_filetype() "{{{
return context_filetype
endfunction"}}}
-function! neosnippet#helpers#get_selected_text(type, ...) "{{{
+function! neosnippet#helpers#get_selected_text(type, ...) abort "{{{
let sel_save = &selection
let &selection = 'inclusive'
let reg_save = @@
@@ -134,7 +134,7 @@ function! neosnippet#helpers#get_selected_text(type, ...) "{{{
call setpos('.', pos)
endtry
endfunction"}}}
-function! neosnippet#helpers#delete_selected_text(type, ...) "{{{
+function! neosnippet#helpers#delete_selected_text(type, ...) abort "{{{
let sel_save = &selection
let &selection = 'inclusive'
let reg_save = @@
@@ -157,7 +157,7 @@ function! neosnippet#helpers#delete_selected_text(type, ...) "{{{
call setpos('.', pos)
endtry
endfunction"}}}
-function! neosnippet#helpers#substitute_selected_text(type, text) "{{{
+function! neosnippet#helpers#substitute_selected_text(type, text) abort "{{{
let sel_save = &selection
let &selection = 'inclusive'
let reg_save = @@
@@ -181,7 +181,7 @@ function! neosnippet#helpers#substitute_selected_text(type, text) "{{{
endtry
endfunction"}}}
-function! s:is_beginning_of_line(cur_text) "{{{
+function! s:is_beginning_of_line(cur_text) abort "{{{
let keyword_pattern = '\S\+'
let cur_keyword_str = matchstr(a:cur_text, keyword_pattern.'$')
let line_part = a:cur_text[: -1-len(cur_keyword_str)]
@@ -190,7 +190,7 @@ function! s:is_beginning_of_line(cur_text) "{{{
return prev_word_end <= 0
endfunction"}}}
-function! s:get_sources_filetypes(filetype) "{{{
+function! s:get_sources_filetypes(filetype) abort "{{{
let filetypes =
\ exists('*context_filetype#get_filetypes') ?
\ context_filetype#get_filetypes(a:filetype) :
@@ -26,27 +26,27 @@
let s:save_cpo = &cpo
set cpo&vim
-function! neosnippet#init#_initialize() "{{{
+function! neosnippet#init#_initialize() abort "{{{
let s:is_initialized = 1
call s:initialize_others()
call s:initialize_cache()
endfunction"}}}
-function! neosnippet#init#check() "{{{
+function! neosnippet#init#check() abort "{{{
if !exists('s:is_initialized')
call neosnippet#init#_initialize()
endif
endfunction"}}}
-function! s:initialize_cache() "{{{
+function! s:initialize_cache() abort "{{{
" Make cache for _ snippets.
call neosnippet#commands#_make_cache('_')
" Initialize check.
call neosnippet#commands#_make_cache(&filetype)
endfunction"}}}
-function! s:initialize_others() "{{{
+function! s:initialize_others() abort "{{{
augroup neosnippet "{{{
autocmd!
" Set make cache event.
@@ -98,7 +98,7 @@ function! s:initialize_others() "{{{
if g:neosnippet#enable_snipmate_compatibility "{{{
" For snipMate function.
- function! Filename(...)
+ function! Filename(...) abort
let filename = expand('%:t:r')
if filename == ''
return a:0 == 2 ? a:2 : ''
Oops, something went wrong.

0 comments on commit 644b551

Please sign in to comment.