Skip to content

Commit 7b822e9

Browse files
committed
Use s:_skip_special_chars function
This is mainly meant to show up better with profiling.
1 parent bcf4146 commit 7b822e9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

indent/python.vim

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,12 @@ let s:stop_statement = '^\s*\(break\|continue\|raise\|return\|pass\)\>'
6969
" Skip strings and comments. Return 1 for chars to skip.
7070
" jedi* refers to syntax definitions from jedi-vim for call signatures, which
7171
" are inserted temporarily into the buffer.
72-
let s:skip_special_chars = 'synIDattr(synID(line("."), col("."), 0), "name") ' .
73-
\ '=~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"'
72+
" let s:skip_special_chars = '(execute("sleep 100m") && 0) || synIDattr(synID(line("."), col("."), 0), "name") ' .
73+
function! s:_skip_special_chars()
74+
return synIDattr(synID(line('.'), col('.'), 0), 'name')
75+
\ =~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"
76+
endfunction
77+
let s:skip_special_chars = 's:_skip_special_chars()'
7478

7579
let s:skip_after_opening_paren = 'synIDattr(synID(line("."), col("."), 0), "name") ' .
7680
\ '=~? "\\vcomment|jedi\\S"'

0 commit comments

Comments
 (0)