]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

s:find_opening_paren: code style
authorDaniel Hahler <git@thequod.de>
Fri, 16 Nov 2018 13:53:53 +0000 (14:53 +0100)
committerDaniel Hahler <git@thequod.de>
Fri, 16 Nov 2018 13:53:53 +0000 (14:53 +0100)
indent/python.vim

index 2797fdbf484a97ed65611125a1baec9c9db7c584..cc9d6c203fb01d77177e2e0c0bb42f3ba9993c98 100644 (file)
@@ -118,17 +118,13 @@ function! s:find_opening_paren(lnum, col)
     call cursor(a:lnum, a:col)
 
     let nearest = [0, 0]
+    let timeout = g:python_pep8_indent_searchpair_timeout
     for [p, maxoff] in items(s:paren_pairs)
         let stopline = max([0, line('.') - maxoff, nearest[0]])
         let found = 0
         while 1
-            let next = searchpairpos(
-               \ '\V'.p[0], '', '\V'.p[1], 'bnW', '', stopline, g:python_pep8_indent_searchpair_timeout)
-
-            if !next[0]
-                break
-            endif
-            if !s:_skip_special_chars(next[0], next[1])
+            let next = searchpairpos('\V'.p[0], '', '\V'.p[1], 'bnW', '', stopline, timeout)
+            if !next[0] || !s:_skip_special_chars(next[0], next[1])
                 break
             endif
             call cursor(next[0], next[1])