diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-07 08:34:28 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-07 08:34:28 -0400 |
| commit | 5165513198dbbe7415f1b8c51225ae8f822628ec (patch) | |
| tree | 3ed35d03f4a1c606ec33a18ee878d61138efbaf2 /src/nvim/testdir/test_execute_func.vim | |
| parent | 4be0e92db01a502863ac4bb26dd0fee16d833145 (diff) | |
| parent | 1def3d1542d6a65f057e743faea39a760b50db87 (diff) | |
| download | rneovim-5165513198dbbe7415f1b8c51225ae8f822628ec.tar.gz rneovim-5165513198dbbe7415f1b8c51225ae8f822628ec.tar.bz2 rneovim-5165513198dbbe7415f1b8c51225ae8f822628ec.zip | |
Merge pull request #13664 from ivechan/win_exectute
vim-patch:8.1.{1418,1425,1832,2124},8.2.{0137, 2340}
Diffstat (limited to 'src/nvim/testdir/test_execute_func.vim')
| -rw-r--r-- | src/nvim/testdir/test_execute_func.vim | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_execute_func.vim b/src/nvim/testdir/test_execute_func.vim index eb84a6739d..15ba894dbe 100644 --- a/src/nvim/testdir/test_execute_func.vim +++ b/src/nvim/testdir/test_execute_func.vim @@ -1,5 +1,7 @@ " test execute() +source view_util.vim + func NestedEval() let nested = execute('echo "nested\nlines"') echo 'got: "' . nested . '"' @@ -82,3 +84,54 @@ func Test_execute_not_silent() endfor call assert_equal('xyz ', text2) endfunc + +func Test_win_execute() + let thiswin = win_getid() + new + let otherwin = win_getid() + call setline(1, 'the new window') + call win_gotoid(thiswin) + let line = win_execute(otherwin, 'echo getline(1)') + call assert_match('the new window', line) + let line = win_execute(134343, 'echo getline(1)') + call assert_equal('', line) + + if has('textprop') + let popupwin = popup_create('the popup win', {'line': 2, 'col': 3}) + redraw + let line = win_execute(popupwin, 'echo getline(1)') + call assert_match('the popup win', line) + + call popup_close(popupwin) + endif + + call win_gotoid(otherwin) + bwipe! +endfunc + +func Test_win_execute_update_ruler() + enew + call setline(1, range(500)) + 20 + split + let winid = win_getid() + set ruler + wincmd w + let height = winheight(winid) + redraw + call assert_match('20,1', Screenline(height + 1)) + let line = win_execute(winid, 'call cursor(100, 1)') + redraw + call assert_match('100,1', Screenline(height + 1)) + + bwipe! +endfunc + +func Test_win_execute_other_tab() + let thiswin = win_getid() + tabnew + call win_execute(thiswin, 'let xyz = 1') + call assert_equal(1, xyz) + tabclose + unlet xyz +endfunc |