Patch 8.1.1348

8 views
Skip to first unread message

Bram Moolenaar

unread,
May 18, 2019, 11:23:18 AM5/18/19
to vim...@googlegroups.com

Patch 8.1.1348
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.
Files: src/testdir/test_edit.vim


*** ../vim-8.1.1347/src/testdir/test_edit.vim 2019-04-27 18:00:29.851064563 +0200
--- src/testdir/test_edit.vim 2019-05-18 16:51:30.495698892 +0200
***************
*** 1359,1367 ****
return
endtry

! " Try to get the Vim window position before setting 'columns'.
let winposx = getwinposx()
let winposy = getwinposy()
let save_columns = &columns
" Need at least about 1100 columns to reproduce the problem.
set columns=2000
--- 1359,1384 ----
return
endtry

! " Try to get the Vim window position before setting 'columns', so that we can
! " move the window back to where it was.
let winposx = getwinposx()
let winposy = getwinposy()
+
+ if winposx >= 0 && winposy >= 0 && !has('gui_running')
+ " We did get the window position, but xterm may report the wrong numbers.
+ " Move the window to the reported position and compute any offset.
+ exe 'winpos ' . winposx . ' ' . winposy
+ sleep 100m
+ let x = getwinposx()
+ if x >= 0
+ let winposx += winposx - x
+ endif
+ let y = getwinposy()
+ if y >= 0
+ let winposy += winposy - y
+ endif
+ endif
+
let save_columns = &columns
" Need at least about 1100 columns to reproduce the problem.
set columns=2000
*** ../vim-8.1.1347/src/version.c 2019-05-18 15:36:06.493897710 +0200
--- src/version.c 2019-05-18 16:53:03.739139925 +0200
***************
*** 769,770 ****
--- 769,772 ----
{ /* Add new patch number below this line */
+ /**/
+ 1348,
/**/

--
The budget process was invented by an alien race of sadistic beings who
resemble large cats.
(Scott Adams - The Dilbert principle)

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages