diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
commit | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch) | |
tree | cd08258054db80bb9a11b1061bb091c70b76926a /runtime/autoload/python.vim | |
parent | eaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-aucmd_textputpost.tar.gz rneovim-aucmd_textputpost.tar.bz2 rneovim-aucmd_textputpost.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'runtime/autoload/python.vim')
-rw-r--r-- | runtime/autoload/python.vim | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/runtime/autoload/python.vim b/runtime/autoload/python.vim index 1eaad09ef5..d5f4862363 100644 --- a/runtime/autoload/python.vim +++ b/runtime/autoload/python.vim @@ -22,8 +22,7 @@ let s:maxoff = 50 " maximum number of lines to look backwards for () function s:SearchBracket(fromlnum, flags) return searchpairpos('[[({]', '', '[])}]', a:flags, \ {-> synstack('.', col('.')) - \ ->map({_, id -> id->synIDattr('name')}) - \ ->match('\%(Comment\|Todo\|String\)$') >= 0}, + \ ->indexof({_, id -> synIDattr(id, 'name') =~ '\%(Comment\|Todo\|String\)$'}) >= 0}, \ [0, a:fromlnum - s:maxoff]->max(), g:python_indent.searchpair_timeout) endfunction @@ -157,15 +156,13 @@ function python#GetIndent(lnum, ...) " the start of the comment. synID() is slow, a linear search would take " too long on a long line. if synstack(plnum, pline_len) - \ ->map({_, id -> id->synIDattr('name')}) - \ ->match('\%(Comment\|Todo\)$') >= 0 + \ ->indexof({_, id -> synIDattr(id, 'name') =~ '\%(Comment\|Todo\)$'}) >= 0 let min = 1 let max = pline_len while min < max let col = (min + max) / 2 if synstack(plnum, col) - \ ->map({_, id -> id->synIDattr('name')}) - \ ->match('\%(Comment\|Todo\)$') >= 0 + \ ->indexof({_, id -> synIDattr(id, 'name') =~ '\%(Comment\|Todo\)$'}) >= 0 let max = col else let min = col + 1 |