runtime(indent-tests): Annotate timed "search*()"es for tracing
related: #17116
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/autoload/dist/vimindent.vim b/runtime/autoload/dist/vimindent.vim
index 0681496..37f2ee5 100644
--- a/runtime/autoload/dist/vimindent.vim
+++ b/runtime/autoload/dist/vimindent.vim
@@ -2,7 +2,7 @@
# Language: Vim script
# Maintainer: github user lacygoill
-# Last Change: 2024 Dec 26
+# Last Change: 2025 Apr 13
#
# Includes changes from The Vim Project:
# - 2024 Feb 09: Fix indent after literal Dict (A. Radev via #13966)
@@ -981,8 +981,10 @@
if end == '[' || end == ']'
e = e->escape('[]')
endif
+ # VIM_INDENT_TEST_TRACE_START
return searchpair('\C' .. s, (middle == '' ? '' : '\C' .. middle), '\C' .. e,
flags, (): bool => InCommentOrString(), stopline, TIMEOUT)
+ # VIM_INDENT_TEST_TRACE_END dist#vimindent#SearchPair
enddef
def SearchPairStart( # {{{3
@@ -1268,7 +1270,9 @@
var pos: list<number> = getcurpos()
cursor(line.lnum, 1)
+ # VIM_INDENT_TEST_TRACE_START
var match_lnum: number = search(pat, 'cnW', line.lnum, TIMEOUT, (): bool => InCommentOrString())
+ # VIM_INDENT_TEST_TRACE_END dist#vimindent#NonCommentedMatch
setpos('.', pos)
return match_lnum > 0
enddef
diff --git a/runtime/autoload/python.vim b/runtime/autoload/python.vim
index d5f4862..cf01198 100644
--- a/runtime/autoload/python.vim
+++ b/runtime/autoload/python.vim
@@ -20,10 +20,12 @@
let s:maxoff = 50 " maximum number of lines to look backwards for ()
function s:SearchBracket(fromlnum, flags)
+ " VIM_INDENT_TEST_TRACE_START
return searchpairpos('[[({]', '', '[])}]', a:flags,
\ {-> synstack('.', col('.'))
\ ->indexof({_, id -> synIDattr(id, 'name') =~ '\%(Comment\|Todo\|String\)$'}) >= 0},
\ [0, a:fromlnum - s:maxoff]->max(), g:python_indent.searchpair_timeout)
+ " VIM_INDENT_TEST_TRACE_END python#s:SearchBracket
endfunction
" See if the specified line is already user-dedented from the expected value.