From: Daniel Hahler Date: Fri, 16 Nov 2018 09:33:01 +0000 (+0100) Subject: Inline s:skip_search X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/5fc36c048e75311b5755b667c1aca7f4d50d3562?ds=sidebyside;hp=0586a518f9cc8a590a35fd2443be4c0677bc45ad Inline s:skip_search --- diff --git a/indent/python.vim b/indent/python.vim index e3c2352..b3631a1 100644 --- a/indent/python.vim +++ b/indent/python.vim @@ -94,9 +94,6 @@ if get(g:, 'python_pep8_indent_skip_concealed', 0) endif -let s:skip_search = 'synIDattr(synID(line("."), col("."), 0), "name") ' . - \ '=~? "comment"' - " Use 'shiftwidth()' instead of '&sw'. " (Since Vim patch 7.3.629, 'shiftwidth' can be set to 0 to follow 'tabstop'). if exists('*shiftwidth') @@ -121,7 +118,9 @@ function! s:find_opening_paren(...) endif " Return if cursor is in a comment. - exe 'if' s:skip_search '| return [0, 0] | endif' + if synIDattr(synID(line('.'), col('.'), 0), 'name') =~? 'comment' + return [0, 0] + endif let nearest = [0, 0] for [p, maxoff] in items(s:paren_pairs)