Mercurial > vim
annotate src/testdir/test_execute_func.vim @ 18675:a0bd0a022bd4 v8.1.2329
patch 8.1.2329: mouse multiple click test is a bit flaky
Commit: https://github.com/vim/vim/commit/44f0bd878ab6525eb50f2e05a13c0854164cdec2
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 21 18:27:01 2019 +0100
patch 8.1.2329: mouse multiple click test is a bit flaky
Problem: Mouse multiple click test is a bit flaky.
Solution: Add it to the list of flaky tests.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 21 Nov 2019 18:30:03 +0100 |
parents | f254dd2bc107 |
children | 49b78d6465e5 |
rev | line source |
---|---|
9454
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " test execute() |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
18259
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
3 source view_util.vim |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
4 |
9454
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 func NestedEval() |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 let nested = execute('echo "nested\nlines"') |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 echo 'got: "' . nested . '"' |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 endfunc |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 func NestedRedir() |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 redir => var |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 echo 'broken' |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 redir END |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 endfunc |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 func Test_execute_string() |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call assert_equal("\nnocompatible", execute('set compatible?')) |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 call assert_equal("\nsomething\nnice", execute('echo "something\nnice"')) |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 call assert_equal("noendofline", execute('echon "noendofline"')) |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 call assert_equal("", execute(123)) |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 call assert_equal("\ngot: \"\nnested\nlines\"", execute('call NestedEval()')) |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 redir => redired |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 echo 'this' |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 let evaled = execute('echo "that"') |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 echo 'theend' |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 redir END |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 call assert_equal("\nthis\ntheend", redired) |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 call assert_equal("\nthat", evaled) |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 call assert_fails('call execute("doesnotexist")', 'E492:') |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 call assert_fails('call execute(3.4)', 'E806:') |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 call assert_fails('call execute("call NestedRedir()")', 'E930:') |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 call assert_equal("\nsomething", execute('echo "something"', '')) |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 call assert_equal("\nsomething", execute('echo "something"', 'silent')) |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 call assert_equal("\nsomething", execute('echo "something"', 'silent!')) |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 call assert_equal("", execute('burp', 'silent!')) |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 call assert_fails('call execute("echo \"x\"", 3.4)', 'E806:') |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 call assert_equal("", execute(test_null_string())) |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 endfunc |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 func Test_execute_list() |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 call assert_equal("\nsomething\nnice", execute(['echo "something"', 'echo "nice"'])) |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 let l = ['for n in range(0, 3)', |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 \ 'echo n', |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 \ 'endfor'] |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 call assert_equal("\n0\n1\n2\n3", execute(l)) |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
50 |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 call assert_equal("", execute([])) |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 call assert_equal("", execute(test_null_list())) |
9da0cb39cbee
commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 endfunc |
15117
2fed75dee954
patch 8.1.0569: execute() always resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
9454
diff
changeset
|
54 |
2fed75dee954
patch 8.1.0569: execute() always resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
9454
diff
changeset
|
55 func Test_execute_does_not_change_col() |
2fed75dee954
patch 8.1.0569: execute() always resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
9454
diff
changeset
|
56 echo '' |
2fed75dee954
patch 8.1.0569: execute() always resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
9454
diff
changeset
|
57 echon 'abcd' |
2fed75dee954
patch 8.1.0569: execute() always resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
9454
diff
changeset
|
58 let x = execute('silent echo 234343') |
2fed75dee954
patch 8.1.0569: execute() always resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
9454
diff
changeset
|
59 echon 'xyz' |
2fed75dee954
patch 8.1.0569: execute() always resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
9454
diff
changeset
|
60 let text = '' |
2fed75dee954
patch 8.1.0569: execute() always resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
9454
diff
changeset
|
61 for col in range(1, 7) |
2fed75dee954
patch 8.1.0569: execute() always resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
9454
diff
changeset
|
62 let text .= nr2char(screenchar(&lines, col)) |
2fed75dee954
patch 8.1.0569: execute() always resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
9454
diff
changeset
|
63 endfor |
2fed75dee954
patch 8.1.0569: execute() always resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
9454
diff
changeset
|
64 call assert_equal('abcdxyz', text) |
2fed75dee954
patch 8.1.0569: execute() always resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
9454
diff
changeset
|
65 endfunc |
15121
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
66 |
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
67 func Test_execute_not_silent() |
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
68 echo '' |
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
69 echon 'abcd' |
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
70 let x = execute('echon 234', '') |
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
71 echo 'xyz' |
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
72 let text1 = '' |
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
73 for col in range(1, 8) |
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
74 let text1 .= nr2char(screenchar(&lines - 1, col)) |
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
75 endfor |
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
76 call assert_equal('abcd234 ', text1) |
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
77 let text2 = '' |
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
78 for col in range(1, 4) |
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
79 let text2 .= nr2char(screenchar(&lines, col)) |
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
80 endfor |
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
81 call assert_equal('xyz ', text2) |
895abc8a5195
patch 8.1.0571: non-silent execute() resets display column to zero
Bram Moolenaar <Bram@vim.org>
parents:
15117
diff
changeset
|
82 endfunc |
16833
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
83 |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
84 func Test_win_execute() |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
85 let thiswin = win_getid() |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
86 new |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
87 let otherwin = win_getid() |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
88 call setline(1, 'the new window') |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
89 call win_gotoid(thiswin) |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
90 let line = win_execute(otherwin, 'echo getline(1)') |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
91 call assert_match('the new window', line) |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
92 |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
93 if has('textprop') |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
94 let popupwin = popup_create('the popup win', {'line': 2, 'col': 3}) |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
95 redraw |
18035
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17670
diff
changeset
|
96 let line = 'echo getline(1)'->win_execute(popupwin) |
16833
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
97 call assert_match('the popup win', line) |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
98 |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
99 call popup_close(popupwin) |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
100 endif |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
101 |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
102 call win_gotoid(otherwin) |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
103 bwipe! |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
15121
diff
changeset
|
104 endfunc |
17670
1be29c149103
patch 8.1.1832: win_execute() does not work in other tab
Bram Moolenaar <Bram@vim.org>
parents:
16878
diff
changeset
|
105 |
18259
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
106 func Test_win_execute_update_ruler() |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
107 enew |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
108 call setline(1, range(500)) |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
109 20 |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
110 split |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
111 let winid = win_getid() |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
112 set ruler |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
113 wincmd w |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
114 let height = winheight(winid) |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
115 redraw |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
116 call assert_match('20,1', Screenline(height + 1)) |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
117 let line = win_execute(winid, 'call cursor(100, 1)') |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
118 redraw |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
119 call assert_match('100,1', Screenline(height + 1)) |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
120 |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
121 bwipe! |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
122 endfunc |
f254dd2bc107
patch 8.1.2124: ruler is not updated if win_execute() moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
123 |
17670
1be29c149103
patch 8.1.1832: win_execute() does not work in other tab
Bram Moolenaar <Bram@vim.org>
parents:
16878
diff
changeset
|
124 func Test_win_execute_other_tab() |
1be29c149103
patch 8.1.1832: win_execute() does not work in other tab
Bram Moolenaar <Bram@vim.org>
parents:
16878
diff
changeset
|
125 let thiswin = win_getid() |
1be29c149103
patch 8.1.1832: win_execute() does not work in other tab
Bram Moolenaar <Bram@vim.org>
parents:
16878
diff
changeset
|
126 tabnew |
1be29c149103
patch 8.1.1832: win_execute() does not work in other tab
Bram Moolenaar <Bram@vim.org>
parents:
16878
diff
changeset
|
127 call win_execute(thiswin, 'let xyz = 1') |
1be29c149103
patch 8.1.1832: win_execute() does not work in other tab
Bram Moolenaar <Bram@vim.org>
parents:
16878
diff
changeset
|
128 call assert_equal(1, xyz) |
1be29c149103
patch 8.1.1832: win_execute() does not work in other tab
Bram Moolenaar <Bram@vim.org>
parents:
16878
diff
changeset
|
129 tabclose |
1be29c149103
patch 8.1.1832: win_execute() does not work in other tab
Bram Moolenaar <Bram@vim.org>
parents:
16878
diff
changeset
|
130 unlet xyz |
1be29c149103
patch 8.1.1832: win_execute() does not work in other tab
Bram Moolenaar <Bram@vim.org>
parents:
16878
diff
changeset
|
131 endfunc |