From: Daniel Hahler Date: Fri, 16 Nov 2018 09:31:44 +0000 (+0100) Subject: Use s:_skip_special_chars function X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/7b822e91aed82e8d41b9578b031b996a64ac7923?ds=inline Use s:_skip_special_chars function This is mainly meant to show up better with profiling. --- diff --git a/indent/python.vim b/indent/python.vim index b038103..96f12c2 100644 --- a/indent/python.vim +++ b/indent/python.vim @@ -69,8 +69,12 @@ let s:stop_statement = '^\s*\(break\|continue\|raise\|return\|pass\)\>' " Skip strings and comments. Return 1 for chars to skip. " jedi* refers to syntax definitions from jedi-vim for call signatures, which " are inserted temporarily into the buffer. -let s:skip_special_chars = 'synIDattr(synID(line("."), col("."), 0), "name") ' . - \ '=~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"' +" let s:skip_special_chars = '(execute("sleep 100m") && 0) || synIDattr(synID(line("."), col("."), 0), "name") ' . +function! s:_skip_special_chars() + return synIDattr(synID(line('.'), col('.'), 0), 'name') + \ =~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S" +endfunction +let s:skip_special_chars = 's:_skip_special_chars()' let s:skip_after_opening_paren = 'synIDattr(synID(line("."), col("."), 0), "name") ' . \ '=~? "\\vcomment|jedi\\S"'