Merge pull request #324 from wsdjeg/master

Add defauly pairs
This commit is contained in:
Shougo 2016-01-18 11:52:25 +09:00
commit b8a1f3a70e
2 changed files with 7 additions and 2 deletions

View File

@ -46,6 +46,8 @@ call neosnippet#util#set_default(
\ 'g:neosnippet#enable_complete_done') \ 'g:neosnippet#enable_complete_done')
call neosnippet#util#set_default( call neosnippet#util#set_default(
\ 'g:neosnippet#enable_auto_clear_markers', 1) \ 'g:neosnippet#enable_auto_clear_markers', 1)
call neosnippet#util#set_default(
\ 'g:neosnippet#completed_pairs',{'_':{ '(' : ')', '{' : '}', '"' : '"' }})
"}}} "}}}
function! neosnippet#expandable_or_jumpable() "{{{ function! neosnippet#expandable_or_jumpable() "{{{

View File

@ -304,8 +304,11 @@ function! neosnippet#parser#_get_completed_snippet(completed_item, next_text) "{
if item.info != '' if item.info != ''
let abbr = split(item.info, '\n')[0] let abbr = split(item.info, '\n')[0]
endif endif
if index(keys(g:neosnippet#completed_pairs),expand(&ft)) < 0
let pairs = { '(' : ')', '{' : '}', '"' : '"' } let pairs = g:neosnippet#completed_pairs._
else
let pairs = g:neosnippet#completed_pairs[expand(&ft)]
endif
let word_pattern = neosnippet#util#escape_pattern(item.word) let word_pattern = neosnippet#util#escape_pattern(item.word)
let angle_pattern = word_pattern . '<.\+>(.*)' let angle_pattern = word_pattern . '<.\+>(.*)'
let no_key = index(keys(pairs), item.word[-1:]) < 0 let no_key = index(keys(pairs), item.word[-1:]) < 0