From 7b822e91aed82e8d41b9578b031b996a64ac7923 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 16 Nov 2018 10:31:44 +0100 Subject: [PATCH] Use s:_skip_special_chars function This is mainly meant to show up better with profiling. --- indent/python.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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"' -- 2.39.5