Mercurial > vim
comparison src/testdir/test_terminal.vim @ 16273:397ab6afe01b v8.1.1141
patch 8.1.1141: terminal winpos test fails with very large terminal
commit https://github.com/vim/vim/commit/1b55797e90c5fe41691afe43aed8afffbbcebeb9
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Apr 9 21:17:32 2019 +0200
patch 8.1.1141: terminal winpos test fails with very large terminal
Problem: Terminal winpos test fails with very large terminal. (Dominique
Pelle)
Solution: Compute the expected size more accurately. (closes #4228)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 09 Apr 2019 21:30:05 +0200 |
parents | d0fef9cb6a9b |
children | 46e8430738fa |
comparison
equal
deleted
inserted
replaced
16272:604c58da9b1c | 16273:397ab6afe01b |
---|---|
1910 let line = term_getline(buf, rows) | 1910 let line = term_getline(buf, rows) |
1911 let xpos = str2nr(substitute(line, '\[\(\d\+\), \d\+\]', '\1', '')) | 1911 let xpos = str2nr(substitute(line, '\[\(\d\+\), \d\+\]', '\1', '')) |
1912 let ypos = str2nr(substitute(line, '\[\d\+, \(\d\+\)\]', '\1', '')) | 1912 let ypos = str2nr(substitute(line, '\[\d\+, \(\d\+\)\]', '\1', '')) |
1913 | 1913 |
1914 " Position must be bigger than the getwinpos() result of Vim itself. | 1914 " Position must be bigger than the getwinpos() result of Vim itself. |
1915 " The calcuation in the console assumes a 10 x 7 character cell. | |
1916 " In the GUI it can be more, let's assume a 20 x 14 cell. | |
1917 " And then add 100 / 200 tolerance. | |
1915 let [xroot, yroot] = getwinpos() | 1918 let [xroot, yroot] = getwinpos() |
1916 call assert_inrange(xroot + 2, xroot + 1000, xpos) | 1919 let [winrow, wincol] = win_screenpos('.') |
1917 call assert_inrange(yroot + 2, yroot + 1000, ypos) | 1920 let xoff = wincol * (has('gui_running') ? 14 : 7) + 100 |
1921 let yoff = winrow * (has('gui_running') ? 20 : 10) + 200 | |
1922 call assert_inrange(xroot + 2, xroot + xoff, xpos) | |
1923 call assert_inrange(yroot + 2, yroot + yoff, ypos) | |
1918 | 1924 |
1919 call term_wait(buf) | 1925 call term_wait(buf) |
1920 call term_sendkeys(buf, ":q\<CR>") | 1926 call term_sendkeys(buf, ":q\<CR>") |
1921 call StopVimInTerminal(buf) | 1927 call StopVimInTerminal(buf) |
1922 call delete('XTest_getwinpos') | 1928 call delete('XTest_getwinpos') |