Skip to content

Commit 978a5cc

Browse files
committed
s:_skip_special_chars: look at synstack
Fixes #132.
1 parent 60ba5e1 commit 978a5cc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

indent/python.vim

+6-4
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ if !get(g:, 'python_pep8_indent_skip_concealed', 0) || !has('conceal')
7676
" jedi* refers to syntax definitions from jedi-vim for call signatures, which
7777
" are inserted temporarily into the buffer.
7878
function! s:_skip_special_chars(line, col)
79-
return synIDattr(synID(a:line, a:col, 0), 'name')
80-
\ =~? s:special_chars_syn_pattern
79+
return match(map(synstack(a:line, a:col),
80+
\ "synIDattr(v:val, 'name')"),
81+
\ '\c'.s:special_chars_syn_pattern) != -1
8182
endfunction
8283
else
8384
" Also ignore anything concealed.
@@ -91,8 +92,9 @@ else
9192
endfunction
9293

9394
function! s:_skip_special_chars(line, col)
94-
return synIDattr(synID(a:line, a:col, 0), 'name')
95-
\ =~? s:special_chars_syn_pattern
95+
return match(map(synstack(a:line, a:col),
96+
\ "synIDattr(v:val, 'name')"),
97+
\ '\c'.s:special_chars_syn_pattern) != -1
9698
\ || s:is_concealed(a:line, a:col)
9799
endfunction
98100
endif

0 commit comments

Comments
 (0)