summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2016-07-24 11:00:50 +0900
committerShougo Matsushita <Shougo.Matsu@gmail.com>2016-07-24 11:00:50 +0900
commit567536aaa3574a6fb5b5457656b97ef0de768423 (patch)
treef3577cda7f83d621f748b939d760d1b232a443ac /autoload
parenta3d794fa5f26d26100af90eafb67c20a47176763 (diff)
downloaddeoplete.nvim-567536aaa3574a6fb5b5457656b97ef0de768423.zip
Fix get_syn_names() error
Diffstat (limited to 'autoload')
-rw-r--r--autoload/deoplete/util.vim19
1 files changed, 12 insertions, 7 deletions
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"}}}