Skip to content

Commit

Permalink
s:_skip_special_chars: look at synstack
Browse files Browse the repository at this point in the history
Fixes Vimjas#132.
  • Loading branch information
blueyed committed Mar 20, 2020
1 parent 60ba5e1 commit 978a5cc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions indent/python.vim
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ if !get(g:, 'python_pep8_indent_skip_concealed', 0) || !has('conceal')
" jedi* refers to syntax definitions from jedi-vim for call signatures, which
" are inserted temporarily into the buffer.
function! s:_skip_special_chars(line, col)
return synIDattr(synID(a:line, a:col, 0), 'name')
\ =~? s:special_chars_syn_pattern
return match(map(synstack(a:line, a:col),
\ "synIDattr(v:val, 'name')"),
\ '\c'.s:special_chars_syn_pattern) != -1
endfunction
else
" Also ignore anything concealed.
Expand All @@ -91,8 +92,9 @@ else
endfunction

function! s:_skip_special_chars(line, col)
return synIDattr(synID(a:line, a:col, 0), 'name')
\ =~? s:special_chars_syn_pattern
return match(map(synstack(a:line, a:col),
\ "synIDattr(v:val, 'name')"),
\ '\c'.s:special_chars_syn_pattern) != -1
\ || s:is_concealed(a:line, a:col)
endfunction
endif
Expand Down

0 comments on commit 978a5cc

Please sign in to comment.