Mercurial > vim
annotate src/testdir/test_cursor_func.vim @ 20407:33166d945b54 v8.2.0758
patch 8.2.0758: Vim9: no test for STORELIST and STOREDICT
Commit: https://github.com/vim/vim/commit/cb7904016eb817e80760c394044740df8273c774
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri May 15 20:53:00 2020 +0200
patch 8.2.0758: Vim9: no test for STORELIST and STOREDICT
Problem: Vim9: no test for STORELIST and STOREDICT.
Solution: Add a test. Make matches stricter.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 15 May 2020 21:00:03 +0200 |
parents | 94f05de75e9f |
children | 2c3e7a6bd6c6 |
rev | line source |
---|---|
7590
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for cursor(). |
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 func Test_wrong_arguments() |
11183
1c4ebbae41d2
patch 8.0.0478: tests use assert_true(0) and assert_false(1) to report errors
Christian Brabandt <cb@256bit.org>
parents:
11105
diff
changeset
|
4 call assert_fails('call cursor(1. 3)', 'E474:') |
20158
94f05de75e9f
patch 8.2.0634: crash with null partial and blob
Bram Moolenaar <Bram@vim.org>
parents:
20109
diff
changeset
|
5 call assert_fails('call cursor(test_null_list())', 'E474:') |
7590
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 endfunc |
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 |
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 func Test_move_cursor() |
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 new |
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 call setline(1, ['aaa', 'bbb', 'ccc', 'ddd']) |
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 |
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 call cursor([1, 1, 0, 1]) |
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 call assert_equal([1, 1, 0, 1], getcurpos()[1:]) |
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 call cursor([4, 3, 0, 3]) |
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 call assert_equal([4, 3, 0, 3], getcurpos()[1:]) |
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 |
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call cursor(2, 2) |
8011
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
18 call assert_equal([2, 2, 0, 2], getcurpos()[1:]) |
7590
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 " line number zero keeps the line number |
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 call cursor(0, 1) |
8011
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
21 call assert_equal([2, 1, 0, 1], getcurpos()[1:]) |
7590
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 " col number zero keeps the column |
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 call cursor(3, 0) |
8011
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
24 call assert_equal([3, 1, 0, 1], getcurpos()[1:]) |
7590
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 " below last line goes to last line |
17837
f71ee7b04f0b
patch 8.1.1915: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17292
diff
changeset
|
26 eval [9, 1]->cursor() |
8011
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
27 call assert_equal([4, 1, 0, 1], getcurpos()[1:]) |
7590
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 |
16668
81be817c9d9a
patch 8.1.1336: some eval functionality is not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
15492
diff
changeset
|
29 call setline(1, ["\<TAB>"]) |
81be817c9d9a
patch 8.1.1336: some eval functionality is not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
15492
diff
changeset
|
30 call cursor(1, 1, 1) |
81be817c9d9a
patch 8.1.1336: some eval functionality is not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
15492
diff
changeset
|
31 call assert_equal([1, 1, 1], getcurpos()[1:3]) |
81be817c9d9a
patch 8.1.1336: some eval functionality is not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
15492
diff
changeset
|
32 |
81be817c9d9a
patch 8.1.1336: some eval functionality is not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
15492
diff
changeset
|
33 call assert_equal(-1, cursor(-1, -1)) |
81be817c9d9a
patch 8.1.1336: some eval functionality is not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
15492
diff
changeset
|
34 |
7590
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 quit! |
4d9814f9fc39
commit https://github.com/vim/vim/commit/5a46a58eb6e50cb5204909cc2202e3400761263f
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 endfunc |
8011
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
37 |
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
38 " Very short version of what matchparen does. |
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
39 function s:Highlight_Matching_Pair() |
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
40 let save_cursor = getcurpos() |
18000
7a19c8d6bb9e
patch 8.1.1996: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
41 eval save_cursor->setpos('.') |
8011
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
42 endfunc |
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
43 |
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
44 func Test_curswant_with_autocommand() |
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
45 new |
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
46 call setline(1, ['func()', '{', '}', '----']) |
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
47 autocmd! CursorMovedI * call s:Highlight_Matching_Pair() |
11105
7c7e496e625d
patch 8.0.0440: not enough test coverage in Insert mode
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
48 call test_override("char_avail", 1) |
8011
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
49 exe "normal! 3Ga\<Down>X\<Esc>" |
11105
7c7e496e625d
patch 8.0.0440: not enough test coverage in Insert mode
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
50 call test_override("char_avail", 0) |
8011
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
51 call assert_equal('-X---', getline(4)) |
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
52 autocmd! CursorMovedI * |
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
53 quit! |
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
54 endfunc |
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7590
diff
changeset
|
55 |
15492
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
56 " Tests for behavior of curswant with cursorcolumn/line |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
57 func Test_curswant_with_cursorcolumn() |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
58 new |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
59 call setline(1, ['01234567', '']) |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
60 exe "normal! ggf6j" |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
61 call assert_equal(6, winsaveview().curswant) |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
62 set cursorcolumn |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
63 call assert_equal(6, winsaveview().curswant) |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
64 quit! |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
65 endfunc |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
66 |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
67 func Test_curswant_with_cursorline() |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
68 new |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
69 call setline(1, ['01234567', '']) |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
70 exe "normal! ggf6j" |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
71 call assert_equal(6, winsaveview().curswant) |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
72 set cursorline |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
73 call assert_equal(6, winsaveview().curswant) |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
74 quit! |
126cdab63a83
patch 8.1.0754: preferred column is lost when setting 'cursorcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
11183
diff
changeset
|
75 endfunc |
17292
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
76 |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
77 func Test_screenpos() |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
78 rightbelow new |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
79 rightbelow 20vsplit |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
80 call setline(1, ["\tsome text", "long wrapping line here", "next line"]) |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
81 redraw |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
82 let winid = win_getid() |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
83 let [winrow, wincol] = win_screenpos(winid) |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
84 call assert_equal({'row': winrow, |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
85 \ 'col': wincol + 0, |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
86 \ 'curscol': wincol + 7, |
18035
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
18000
diff
changeset
|
87 \ 'endcol': wincol + 7}, winid->screenpos(1, 1)) |
17292
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
88 call assert_equal({'row': winrow, |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
89 \ 'col': wincol + 13, |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
90 \ 'curscol': wincol + 13, |
17994
0dcc2ee838dd
patch 8.1.1993: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17837
diff
changeset
|
91 \ 'endcol': wincol + 13}, winid->screenpos(1, 7)) |
17292
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
92 call assert_equal({'row': winrow + 2, |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
93 \ 'col': wincol + 1, |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
94 \ 'curscol': wincol + 1, |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
95 \ 'endcol': wincol + 1}, screenpos(winid, 2, 22)) |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
96 setlocal number |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
97 call assert_equal({'row': winrow + 3, |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
98 \ 'col': wincol + 9, |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
99 \ 'curscol': wincol + 9, |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
100 \ 'endcol': wincol + 9}, screenpos(winid, 2, 22)) |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
101 close |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
102 bwipe! |
8a095d343c59
patch 8.1.1645: cannot use a popup window for a balloon
Bram Moolenaar <Bram@vim.org>
parents:
16668
diff
changeset
|
103 endfunc |
18469
66964658cc3c
patch 8.1.2228: screenpos() returns wrong values when 'number' is set
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
104 |
66964658cc3c
patch 8.1.2228: screenpos() returns wrong values when 'number' is set
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
105 func Test_screenpos_number() |
66964658cc3c
patch 8.1.2228: screenpos() returns wrong values when 'number' is set
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
106 rightbelow new |
66964658cc3c
patch 8.1.2228: screenpos() returns wrong values when 'number' is set
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
107 rightbelow 73vsplit |
66964658cc3c
patch 8.1.2228: screenpos() returns wrong values when 'number' is set
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
108 call setline (1, repeat('x', 66)) |
66964658cc3c
patch 8.1.2228: screenpos() returns wrong values when 'number' is set
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
109 setlocal number |
66964658cc3c
patch 8.1.2228: screenpos() returns wrong values when 'number' is set
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
110 redraw |
66964658cc3c
patch 8.1.2228: screenpos() returns wrong values when 'number' is set
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
111 let winid = win_getid() |
66964658cc3c
patch 8.1.2228: screenpos() returns wrong values when 'number' is set
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
112 let [winrow, wincol] = win_screenpos(winid) |
66964658cc3c
patch 8.1.2228: screenpos() returns wrong values when 'number' is set
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
113 let pos = screenpos(winid, 1, 66) |
66964658cc3c
patch 8.1.2228: screenpos() returns wrong values when 'number' is set
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
114 call assert_equal(winrow, pos.row) |
66964658cc3c
patch 8.1.2228: screenpos() returns wrong values when 'number' is set
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
115 call assert_equal(wincol + 66 + 3, pos.col) |
66964658cc3c
patch 8.1.2228: screenpos() returns wrong values when 'number' is set
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
116 close |
66964658cc3c
patch 8.1.2228: screenpos() returns wrong values when 'number' is set
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
117 bwipe! |
66964658cc3c
patch 8.1.2228: screenpos() returns wrong values when 'number' is set
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
118 endfunc |
20109
e82996ad131f
patch 8.2.0610: some tests are still old style
Bram Moolenaar <Bram@vim.org>
parents:
18469
diff
changeset
|
119 |
e82996ad131f
patch 8.2.0610: some tests are still old style
Bram Moolenaar <Bram@vim.org>
parents:
18469
diff
changeset
|
120 " vim: shiftwidth=2 sts=2 expandtab |