]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(indent-tests): Raise timeouts for "search*()"es
authorAliaksei Budavei <0x000c70@gmail.com>
Sun, 13 Apr 2025 19:24:46 +0000 (22:24 +0300)
committerChristian Brabandt <cb@256bit.org>
Sat, 19 Apr 2025 09:36:05 +0000 (11:36 +0200)
Related to #15974 and #16870.

closes: #17116

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
12 files changed:
runtime/indent/testdir/README.txt
runtime/indent/testdir/bitbake.in
runtime/indent/testdir/bitbake.ok
runtime/indent/testdir/html.in
runtime/indent/testdir/html.ok
runtime/indent/testdir/python.in
runtime/indent/testdir/python.ok
runtime/indent/testdir/runtest.vim
runtime/indent/testdir/vim.in
runtime/indent/testdir/vim.ok
runtime/indent/testdir/vim9.in
runtime/indent/testdir/vim9.ok

index 65975605c234a27f65093b3df520b6250d56068f..7454210ef03b659f918ed17d5a19b90959feb09e 100644 (file)
@@ -36,6 +36,9 @@ First of all, create a FILETYPE.in file.  It should contain:
              \ 'string'
        " END_INDENT
 
+  When an indent script utilises timed "search*()"es and supports related
+  timeout configuration, consider setting a generous timeout value from
+  INDENT_EXE lines (look at "g:vim_indent" in "testdir/vim.in" for details).
   Note that the command is not undone, you may need to reverse the effect for
   the next block of lines.
 
index afd19be18228987054bd00d4aac4b53fe8e58bd8..97b760fc59e2b535bfc22f4ca1e3e66a894c9161 100644 (file)
@@ -1,6 +1,8 @@
 # vim: set filetype=bitbake :
 
 # START_INDENT
+# INDENT_EXE let g:pyindent_searchpair_timeout = 64
+# INDENT_EXE runtime autoload/python.vim
 FOO = " \
     bar \
     baz \
index 1bc5a18c6f4c974cdb88b5228678f895d491b7d3..000ef5084728e4ff9bf6682d33fb51ce0a86450a 100644 (file)
@@ -1,6 +1,8 @@
 # vim: set filetype=bitbake :
 
 # START_INDENT
+# INDENT_EXE let g:pyindent_searchpair_timeout = 64
+# INDENT_EXE runtime autoload/python.vim
 FOO = " \
     bar \
     baz \
index 4783a096d0d962d9f3aa6b00fc28e337ab2752dc..72a38b93c195117cab5f0e08b4b373c37c9d5855 100644 (file)
@@ -2,6 +2,7 @@
 
 
 % START_INDENT
+% INDENT_EXE let b:html_indent_line_limit = 64
 <html>
     <body>
 <style>
index 4963634465c6f9a1b3c2234ba845da7a9c4b1999..c6ba3af27433236538d5ffb103b74519ab20ce6f 100644 (file)
@@ -2,6 +2,7 @@
 
 
 % START_INDENT
+% INDENT_EXE let b:html_indent_line_limit = 64
 <html>
     <body>
        <style>
index 57719ee430e2a5c5efa5e0af4f51945332424314..1f7654ae933240aa0f53ed0379eb90929b5450dc 100644 (file)
@@ -1,6 +1,8 @@
 # vim: set ft=python sw=4 et:
 
 # START_INDENT
+# INDENT_EXE let g:pyindent_searchpair_timeout = 256
+# INDENT_EXE runtime autoload/python.vim
 dict = {
 'a': 1,
 'b': 2,
index f5ebbc2285bee4571bf8f9ac0d9408fe22f97f5c..aaeb69cdf3bb99bcb8602bc499833a11b1cf477e 100644 (file)
@@ -1,6 +1,8 @@
 # vim: set ft=python sw=4 et:
 
 # START_INDENT
+# INDENT_EXE let g:pyindent_searchpair_timeout = 256
+# INDENT_EXE runtime autoload/python.vim
 dict = {
         'a': 1,
         'b': 2,
index 9559a810b1a05a303124efdc3fcacc8e59d2246a..dde8c5c47bfba972993fd9654a6d032a797490bb 100644 (file)
@@ -14,19 +14,6 @@ set modeline
 set debug=throw
 set nomore
 
-" Remember the directory where we started.
-let indentDir = getcwd()
-cd ../../src/testdir
-
-" Needed for ValgrindOrAsan().
-source shared.vim
-exe 'cd ' .. fnameescape(indentDir)
-
-if ValgrindOrAsan()
-  let g:vim_indent = {"searchpair_timeout": 1024}
-  let g:python_indent = {"searchpair_timeout": 1024}
-endif
-
 au! SwapExists * call HandleSwapExists()
 func HandleSwapExists()
   " Ignore finding a swap file for the test input and output, the user might be
index 6b894b510751c99dde7b1ebc72da7ca7cb159c88..d5cae222fb626ee18577b665899119c1adc66f8e 100644 (file)
@@ -1,6 +1,8 @@
 " vim: set ft=vim sw=4 :
 
 " START_INDENT
+" INDENT_EXE let g:vim_indent = {'searchpair_timeout': 1024}
+" INDENT_EXE runtime autoload/dist/vimindent.vim
 func Some()
 let x = 1
 endfunc
index 29878294bb0f365c9dd974019e9d2d7a3cc57e3b..d52eda6f5bc3951a198e6f8f8eeecebb89c28c74 100644 (file)
@@ -1,6 +1,8 @@
 " vim: set ft=vim sw=4 :
 
 " START_INDENT
+" INDENT_EXE let g:vim_indent = {'searchpair_timeout': 1024}
+" INDENT_EXE runtime autoload/dist/vimindent.vim
 func Some()
     let x = 1
 endfunc
index a14d4e7d177824d911681935e00d88a5ed09d29f..d4d0399e5eada1b3ba18dd17fd1286938b7127dd 100644 (file)
@@ -2,6 +2,8 @@ vim9script
 # vim: set ft=vim sw=4 :
 
 # START_INDENT
+# INDENT_EXE let g:vim_indent = {'searchpair_timeout': 8192}
+# INDENT_EXE runtime autoload/dist/vimindent.vim
 var result = Func(
 arg1,
 arg2
@@ -455,7 +457,7 @@ enddef
 # END_INDENT
 
 # START_INDENT
-# INDENT_EXE let g:vim_indent = {'more_in_bracket_block': v:true}
+# INDENT_EXE let g:vim_indent.more_in_bracket_block = v:true
 def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any))
 return (Emit: func(any)) => {
 Cont((t: any) => {
@@ -468,7 +470,7 @@ enddef
 # END_INDENT
 
 # START_INDENT
-# INDENT_EXE unlet! g:vim_indent
+# INDENT_EXE let g:vim_indent = {'searchpair_timeout': 8192}
 # END_INDENT
 
 # START_INDENT
index e4ba72ca101ba85dd2f40baf086eac512cc613c8..afad454afee05bc343c29435cbb9bdf5da8e3223 100644 (file)
@@ -2,6 +2,8 @@ vim9script
 # vim: set ft=vim sw=4 :
 
 # START_INDENT
+# INDENT_EXE let g:vim_indent = {'searchpair_timeout': 8192}
+# INDENT_EXE runtime autoload/dist/vimindent.vim
 var result = Func(
     arg1,
     arg2
@@ -455,7 +457,7 @@ enddef
 # END_INDENT
 
 # START_INDENT
-# INDENT_EXE let g:vim_indent = {'more_in_bracket_block': v:true}
+# INDENT_EXE let g:vim_indent.more_in_bracket_block = v:true
 def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any))
     return (Emit: func(any)) => {
            Cont((t: any) => {
@@ -468,7 +470,7 @@ enddef
 # END_INDENT
 
 # START_INDENT
-# INDENT_EXE unlet! g:vim_indent
+# INDENT_EXE let g:vim_indent = {'searchpair_timeout': 8192}
 # END_INDENT
 
 # START_INDENT