Mercurial > vim
comparison src/testdir/test_terminal.vim @ 26554:7a74515dde6b v8.2.3806
patch 8.2.3806: terminal focus test fails sometimes
Commit: https://github.com/vim/vim/commit/c2958585f6c7ce4d822d3191ba501c0757b3ffff
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Dec 14 11:16:31 2021 +0000
patch 8.2.3806: terminal focus test fails sometimes
Problem: Terminal focus test fails sometimes.
Solution: Run the test function before others.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 14 Dec 2021 12:30:03 +0100 |
parents | d9aac1eaf9a3 |
children | b3ac5a4dc158 |
comparison
equal
deleted
inserted
replaced
26553:9b89e8317f8e | 26554:7a74515dde6b |
---|---|
1122 call StopShellInTerminal(buf) | 1122 call StopShellInTerminal(buf) |
1123 exe buf . 'bwipe' | 1123 exe buf . 'bwipe' |
1124 unlet g:job | 1124 unlet g:job |
1125 endfunc | 1125 endfunc |
1126 | 1126 |
1127 func Test_terminal_focus_events() | 1127 " Run this first, it fails when run after other tests. |
1128 func Test_aa_terminal_focus_events() | |
1128 CheckNotGui | 1129 CheckNotGui |
1129 CheckUnix | 1130 CheckUnix |
1130 CheckRunVimInTerminal | 1131 CheckRunVimInTerminal |
1131 | 1132 |
1132 let save_term = &term | 1133 let save_term = &term |
1135 | 1136 |
1136 let lines =<< trim END | 1137 let lines =<< trim END |
1137 set term=xterm ttymouse=xterm2 | 1138 set term=xterm ttymouse=xterm2 |
1138 au FocusLost * call setline(1, 'I am lost') | set nomod | 1139 au FocusLost * call setline(1, 'I am lost') | set nomod |
1139 au FocusGained * call setline(1, 'I am back') | set nomod | 1140 au FocusGained * call setline(1, 'I am back') | set nomod |
1140 " FIXME: sometimes this job hangs, exit after a couple of seconds | |
1141 call timer_start(2000, {id -> execute('qall')}) | |
1142 END | 1141 END |
1143 call writefile(lines, 'XtermFocus') | 1142 call writefile(lines, 'XtermFocus') |
1144 let buf = RunVimInTerminal('-S XtermFocus', #{rows: 6}) | 1143 let buf = RunVimInTerminal('-S XtermFocus', #{rows: 6}) |
1145 | 1144 |
1146 " Send a focus event to ourselves, it should be forwarded to the terminal | 1145 " Send a focus event to ourselves, it should be forwarded to the terminal |