comparison src/testdir/test_edit.vim @ 16692:2e689fb67c91 v8.1.1348

patch 8.1.1348: running tests may cause the window to move commit https://github.com/vim/vim/commit/f8191c5f07c650b75b85c5a5b3d000fd5cae1643 Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 18 17:22:54 2019 +0200 patch 8.1.1348: running tests may cause the window to move Problem: Running tests may cause the window to move. Solution: Correct the reported window position for the offset with the position after ":winpos". Works around an xterm bug.
author Bram Moolenaar <Bram@vim.org>
date Sat, 18 May 2019 17:30:05 +0200
parents aebcd20a8a3f
children 4935244c1128
comparison
equal deleted inserted replaced
16691:21feeb36354f 16692:2e689fb67c91
1357 " Long directory name probably not supported. 1357 " Long directory name probably not supported.
1358 call delete(dirname, 'rf') 1358 call delete(dirname, 'rf')
1359 return 1359 return
1360 endtry 1360 endtry
1361 1361
1362 " Try to get the Vim window position before setting 'columns'. 1362 " Try to get the Vim window position before setting 'columns', so that we can
1363 " move the window back to where it was.
1363 let winposx = getwinposx() 1364 let winposx = getwinposx()
1364 let winposy = getwinposy() 1365 let winposy = getwinposy()
1366
1367 if winposx >= 0 && winposy >= 0 && !has('gui_running')
1368 " We did get the window position, but xterm may report the wrong numbers.
1369 " Move the window to the reported position and compute any offset.
1370 exe 'winpos ' . winposx . ' ' . winposy
1371 sleep 100m
1372 let x = getwinposx()
1373 if x >= 0
1374 let winposx += winposx - x
1375 endif
1376 let y = getwinposy()
1377 if y >= 0
1378 let winposy += winposy - y
1379 endif
1380 endif
1381
1365 let save_columns = &columns 1382 let save_columns = &columns
1366 " Need at least about 1100 columns to reproduce the problem. 1383 " Need at least about 1100 columns to reproduce the problem.
1367 set columns=2000 1384 set columns=2000
1368 set noswapfile 1385 set noswapfile
1369 1386