summaryrefslogtreecommitdiffstats
path: root/src/testdir/term_util.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-16 23:18:51 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-16 23:18:51 +0200
commit101f4810e27e432970bc8809e18f018e1795937f (patch)
treee9087cbb9b5d767866fce51696cce626fc21d051 /src/testdir/term_util.vim
parent0fe937fd8616fcd24b1b1ef2ab9f1657615dd22c (diff)
patch 8.2.0992: Vim9: crash when using :import in the Vim commandv8.2.0992
Problem: Vim9: crash when using :import in the Vim command. Solution: Give an error when using :import outside of a script. (closes #6271)
Diffstat (limited to 'src/testdir/term_util.vim')
-rw-r--r--src/testdir/term_util.vim22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/testdir/term_util.vim b/src/testdir/term_util.vim
index df7cfa54cf..7c071bb3f8 100644
--- a/src/testdir/term_util.vim
+++ b/src/testdir/term_util.vim
@@ -107,16 +107,18 @@ func RunVimInTerminal(arguments, options)
call TermWait(buf)
- " Wait for "All" or "Top" of the ruler to be shown in the last line or in
- " the status line of the last window. This can be quite slow (e.g. when
- " using valgrind).
- " If it fails then show the terminal contents for debugging.
- try
- call WaitFor({-> len(term_getline(buf, rows)) >= cols - 1 || len(term_getline(buf, rows - statusoff)) >= cols - 1})
- catch /timed out after/
- let lines = map(range(1, rows), {key, val -> term_getline(buf, val)})
- call assert_report('RunVimInTerminal() failed, screen contents: ' . join(lines, "<NL>"))
- endtry
+ if get(a:options, 'wait_for_ruler', 1)
+ " Wait for "All" or "Top" of the ruler to be shown in the last line or in
+ " the status line of the last window. This can be quite slow (e.g. when
+ " using valgrind).
+ " If it fails then show the terminal contents for debugging.
+ try
+ call WaitFor({-> len(term_getline(buf, rows)) >= cols - 1 || len(term_getline(buf, rows - statusoff)) >= cols - 1})
+ catch /timed out after/
+ let lines = map(range(1, rows), {key, val -> term_getline(buf, val)})
+ call assert_report('RunVimInTerminal() failed, screen contents: ' . join(lines, "<NL>"))
+ endtry
+ endif
" Starting a terminal to run Vim is always considered flaky.
let g:test_is_flaky = 1