comparison src/testdir/test_terminal.vim @ 16241:c1698187c482 v8.1.1125

patch 8.1.1125: libvterm does not handle the window position report commit https://github.com/vim/vim/commit/fa1e90cd4d1bebd66da22df4625f70963f091f17 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 6 17:47:40 2019 +0200 patch 8.1.1125: libvterm does not handle the window position report Problem: Libvterm does not handle the window position report. Solution: Let libvterm call the fallback CSI handler when not handling CSI sequence. Handle the window position report in Vim.
author Bram Moolenaar <Bram@vim.org>
date Sat, 06 Apr 2019 18:00:05 +0200
parents 59177d9466aa
children e0a6298bd70f
comparison
equal deleted inserted replaced
16240:96666592655f 16241:c1698187c482
1885 sleep 2 1885 sleep 2
1886 exe tbuf . 'bwipe!' 1886 exe tbuf . 'bwipe!'
1887 au! BufLeave 1887 au! BufLeave
1888 set statusline= 1888 set statusline=
1889 endfunc 1889 endfunc
1890
1891 func Test_terminal_getwinpos()
1892 " split, go to the bottom-right window
1893 split
1894 wincmd j
1895 set splitright
1896
1897 call writefile([
1898 \ 'echo getwinpos()',
1899 \ ], 'XTest_getwinpos')
1900 let buf = RunVimInTerminal('-S XTest_getwinpos', {'cols': 60})
1901 call term_wait(buf)
1902
1903 " Find the output of getwinpos() in the bottom line.
1904 let rows = term_getsize(buf)[0]
1905 call WaitForAssert({-> assert_match('\[\d\+, \d\+\]', term_getline(buf, rows))})
1906 let line = term_getline(buf, rows)
1907 let xpos = str2nr(substitute(line, '\[\(\d\+\), \d\+\]', '\1', ''))
1908 let ypos = str2nr(substitute(line, '\[\d\+, \(\d\+\)\]', '\1', ''))
1909
1910 " Position must be bigger than the getwinpos() result of Vim itself.
1911 let [xroot, yroot] = getwinpos()
1912 call assert_inrange(xroot + 2, xroot + 1000, xpos)
1913 call assert_inrange(yroot + 2, yroot + 1000, ypos)
1914
1915 call term_wait(buf)
1916 call term_sendkeys(buf, ":q\<CR>")
1917 call StopVimInTerminal(buf)
1918 call delete('XTest_getwinpos')
1919 exe buf . 'bwipe!'
1920 set splitright&
1921 only!
1922 endfunc