From 567536aaa3574a6fb5b5457656b97ef0de768423 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sun, 24 Jul 2016 11:00:50 +0900 Subject: Fix get_syn_names() error --- autoload/deoplete/util.vim | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'autoload') diff --git a/autoload/deoplete/util.vim b/autoload/deoplete/util.vim index 7956eea..35f3669 100644 --- a/autoload/deoplete/util.vim +++ b/autoload/deoplete/util.vim @@ -145,13 +145,18 @@ function! deoplete#util#get_syn_names() abort "{{{ endif let names = [] - for id in synstack(line('.'), (mode() ==# 'i' ? col('.')-1 : col('.'))) - let name = synIDattr(id, 'name') - call add(names, name) - if synIDattr(synIDtrans(id), 'name') !=# name - call add(names, synIDattr(synIDtrans(id), 'name')) - endif - endfor + try + " Note: synstack() seems broken in concealed text. + for id in synstack(line('.'), (mode() ==# 'i' ? col('.')-1 : col('.'))) + let name = synIDattr(id, 'name') + call add(names, name) + if synIDattr(synIDtrans(id), 'name') !=# name + call add(names, synIDattr(synIDtrans(id), 'name')) + endif + endfor + catch + " Ignore error + endtry return names endfunction"}}} -- cgit v1.2.3