Mercurial > vim
annotate src/testdir/test_textobjects.vim @ 33374:62a34e280593 v9.0.1946
patch 9.0.1946: filename expansion using ** in bash may fail
Commit: https://github.com/vim/vim/commit/9eb1ce531527a7177d16373b0f8689bbcd3d5f73
Author: Christian Brabandt <cb@256bit.org>
Date: Wed Sep 27 19:08:25 2023 +0200
patch 9.0.1946: filename expansion using ** in bash may fail
Problem: filename expansion using ** in bash may fail
Solution: Try to enable the globstar setting
Starting with bash 4.0 it supports extended globbing using the globstar
shell option. This makes matching recursively below a certain directory
using the ** pattern work as expected nowadays. However, we need to
explicitly enable this using the 'shopt -s globstar' bash command.
So let's check the bash environment variable $BASH_VERSINFO (which is
supported since bash 3.0 and conditionally enable the globstar option,
if the major version is at least 4. For older bashs, this at least
shouldn't cause errors (unless one is using really ancient bash 2.X or
something).
closes: #13002
closes: #13144
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 27 Sep 2023 19:15:06 +0200 |
parents | bc6cf208b1b4 |
children | 21fc3f1676be |
rev | line source |
---|---|
9642
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test for textobjects |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
17089
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
17049
diff
changeset
|
3 source check.vim |
9642
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 |
11478
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
5 func CpoM(line, useM, expected) |
9642
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 new |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 if a:useM |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 set cpoptions+=M |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 else |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 set cpoptions-=M |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 endif |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 call setline(1, a:line) |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 call setreg('"', '') |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 normal! ggfrmavi)y |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 call assert_equal(getreg('"'), a:expected[0]) |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 call setreg('"', '') |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 normal! `afbmavi)y |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 call assert_equal(getreg('"'), a:expected[1]) |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 call setreg('"', '') |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 normal! `afgmavi)y |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 call assert_equal(getreg('"'), a:expected[2]) |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 |
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 q! |
11478
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
29 endfunc |
9642
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 |
11478
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
31 func Test_inner_block_without_cpo_M() |
9642
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 call CpoM('(red \(blue) green)', 0, ['red \(blue', 'red \(blue', '']) |
11478
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
33 endfunc |
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
34 |
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
35 func Test_inner_block_with_cpo_M_left_backslash() |
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
36 call CpoM('(red \(blue) green)', 1, ['red \(blue) green', 'blue', 'red \(blue) green']) |
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
37 endfunc |
9642
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 |
11478
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
39 func Test_inner_block_with_cpo_M_right_backslash() |
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
40 call CpoM('(red (blue\) green)', 1, ['red (blue\) green', 'blue\', 'red (blue\) green']) |
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
41 endfunc |
9642
8cc4dfadfd48
commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 |
28980
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
43 func Test_inner_block_single_char() |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
44 new |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
45 call setline(1, "(a)") |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
46 |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
47 set selection=inclusive |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
48 let @" = '' |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
49 call assert_nobeep('norm! 0faviby') |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
50 call assert_equal('a', @") |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
51 |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
52 set selection=exclusive |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
53 let @" = '' |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
54 call assert_nobeep('norm! 0faviby') |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
55 call assert_equal('a', @") |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
56 |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
57 set selection& |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
58 bwipe! |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
59 endfunc |
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
60 |
11478
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
61 func Test_quote_selection_selection_exclusive() |
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
62 new |
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
63 call setline(1, "a 'bcde' f") |
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
64 set selection=exclusive |
18677
953e83e09e78
patch 8.1.2330: vi' does not always work when 'selection' is exclusive
Bram Moolenaar <Bram@vim.org>
parents:
18644
diff
changeset
|
65 |
11478
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
66 exe "norm! fdvhi'y" |
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
67 call assert_equal('bcde', @") |
18677
953e83e09e78
patch 8.1.2330: vi' does not always work when 'selection' is exclusive
Bram Moolenaar <Bram@vim.org>
parents:
18644
diff
changeset
|
68 |
28980
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
69 let @" = 'dummy' |
18644
7bfe68b637be
patch 8.1.2314: vi' sometimes does not select anything
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
70 exe "norm! $gevi'y" |
7bfe68b637be
patch 8.1.2314: vi' sometimes does not select anything
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
71 call assert_equal('bcde', @") |
18677
953e83e09e78
patch 8.1.2330: vi' does not always work when 'selection' is exclusive
Bram Moolenaar <Bram@vim.org>
parents:
18644
diff
changeset
|
72 |
28980
42e3dfd5b2d6
patch 8.2.5012: cannot select one character inside ()
Bram Moolenaar <Bram@vim.org>
parents:
28802
diff
changeset
|
73 let @" = 'dummy' |
18677
953e83e09e78
patch 8.1.2330: vi' does not always work when 'selection' is exclusive
Bram Moolenaar <Bram@vim.org>
parents:
18644
diff
changeset
|
74 exe "norm! 0fbhvi'y" |
953e83e09e78
patch 8.1.2330: vi' does not always work when 'selection' is exclusive
Bram Moolenaar <Bram@vim.org>
parents:
18644
diff
changeset
|
75 call assert_equal('bcde', @") |
953e83e09e78
patch 8.1.2330: vi' does not always work when 'selection' is exclusive
Bram Moolenaar <Bram@vim.org>
parents:
18644
diff
changeset
|
76 |
11478
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
77 set selection&vim |
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
78 bw! |
29a781fd3f27
patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
79 endfunc |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
80 |
15930
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
81 func Test_quote_selection_selection_exclusive_abort() |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
82 new |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
83 set selection=exclusive |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
84 call setline(1, "'abzzc'") |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
85 let exp_curs = [0, 1, 6, 0] |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
86 call cursor(1,1) |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
87 exe 'norm! fcdvi"' |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
88 " make sure to end visual mode to have a clear state |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
89 exe "norm! \<esc>" |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
90 call assert_equal(exp_curs, getpos('.')) |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
91 call cursor(1,1) |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
92 exe 'norm! fcvi"' |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
93 exe "norm! \<esc>" |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
94 call assert_equal(exp_curs, getpos('.')) |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
95 call cursor(1,2) |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
96 exe 'norm! vfcoi"' |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
97 exe "norm! \<esc>" |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
98 let exp_curs = [0, 1, 2, 0] |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
99 let exp_visu = [0, 1, 7, 0] |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
100 call assert_equal(exp_curs, getpos('.')) |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
101 call assert_equal(exp_visu, getpos("'>")) |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
102 set selection&vim |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
103 bw! |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
104 endfunc |
e580c9d75443
patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
105 |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
106 " Tests for string and html text objects |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
107 func Test_string_html_objects() |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
108 |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
109 for e in ['utf-8', 'latin1', 'cp932'] |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
110 enew! |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
111 exe 'set enc=' .. e |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
112 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
113 let t = '"wo\"rd\\" foo' |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
114 put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
115 normal! da" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
116 call assert_equal('foo', getline('.'), e) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
117 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
118 let t = "'foo' 'bar' 'piep'" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
119 put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
120 normal! 0va'a'rx |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
121 call assert_equal("xxxxxxxxxxxx'piep'", getline('.'), e) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
122 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
123 let t = "bla bla `quote` blah" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
124 put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
125 normal! 02f`da` |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
126 call assert_equal("bla bla blah", getline('.'), e) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
127 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
128 let t = 'out " in "noXno"' |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
129 put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
130 normal! 0fXdi" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
131 call assert_equal('out " in ""', getline('.'), e) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
132 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
133 let t = "\"'\" 'blah' rep 'buh'" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
134 put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
135 normal! 03f'vi'ry |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
136 call assert_equal("\"'\" 'blah'yyyyy'buh'", getline('.'), e) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
137 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
138 set quoteescape=+*- |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
139 let t = "bla `s*`d-`+++`l**` b`la" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
140 put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
141 normal! di` |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
142 call assert_equal("bla `` b`la", getline('.'), e) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
143 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
144 let t = 'voo "nah" sdf " asdf" sdf " sdf" sd' |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
145 put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
146 normal! $F"va"oha"i"rz |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
147 call assert_equal('voo "zzzzzzzzzzzzzzzzzzzzzzzzzzzzsd', getline('.'), e) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
148 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
149 let t = "-<b>asdf<i>Xasdf</i>asdf</b>-" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
150 put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
151 normal! fXdit |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
152 call assert_equal('-<b>asdf<i></i>asdf</b>-', getline('.'), e) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
153 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
154 let t = "-<b>asdX<i>a<i />sdf</i>asdf</b>-" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
155 put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
156 normal! 0fXdit |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
157 call assert_equal('-<b></b>-', getline('.'), e) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
158 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
159 let t = "-<b>asdf<i>Xasdf</i>asdf</b>-" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
160 put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
161 normal! fXdat |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
162 call assert_equal('-<b>asdfasdf</b>-', getline('.'), e) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
163 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
164 let t = "-<b>asdX<i>as<b />df</i>asdf</b>-" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
165 put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
166 normal! 0fXdat |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
167 call assert_equal('--', getline('.'), e) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
168 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
169 let t = "-<b>\ninnertext object\n</b>" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
170 put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
171 normal! dit |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
172 call assert_equal('-<b></b>', getline('.'), e) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
173 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
174 " copy the tag block from leading indentation before the start tag |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
175 let t = " <b>\ntext\n</b>" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
176 $put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
177 normal! 2kvaty |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
178 call assert_equal("<b>\ntext\n</b>", @", e) |
20199
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
179 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
180 " copy the tag block from the end tag |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
181 let t = "<title>\nwelcome\n</title>" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
182 $put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
183 normal! $vaty |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
184 call assert_equal("<title>\nwelcome\n</title>", @", e) |
20199
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
185 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
186 " copy the outer tag block from a tag without an end tag |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
187 let t = "<html>\n<title>welcome\n</html>" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
188 $put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
189 normal! k$vaty |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
190 call assert_equal("<html>\n<title>welcome\n</html>", @", e) |
20199
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
191 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
192 " nested tag that has < in a different line from > |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
193 let t = "<div><div\n></div></div>" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
194 $put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
195 normal! k0vaty |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
196 call assert_equal("<div><div\n></div></div>", @", e) |
22604
3ac0ef0578ef
patch 8.2.1850: "vat" does not select tags correctly over line break
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
197 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
198 " nested tag with attribute that has < in a different line from > |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
199 let t = "<div><div\nattr=\"attr\"\n></div></div>" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
200 $put =t |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
201 normal! 2k0vaty |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
202 call assert_equal("<div><div\nattr=\"attr\"\n></div></div>", @", e) |
22604
3ac0ef0578ef
patch 8.2.1850: "vat" does not select tags correctly over line break
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
203 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
204 set quoteescape& |
28802
1ab5add6f4e8
patch 8.2.4925: trailing backslash may cause reading past end of line
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
205 |
1ab5add6f4e8
patch 8.2.4925: trailing backslash may cause reading past end of line
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
206 " this was going beyond the end of the line |
1ab5add6f4e8
patch 8.2.4925: trailing backslash may cause reading past end of line
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
207 %del |
1ab5add6f4e8
patch 8.2.4925: trailing backslash may cause reading past end of line
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
208 sil! norm i"\ |
1ab5add6f4e8
patch 8.2.4925: trailing backslash may cause reading past end of line
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
209 sil! norm i"\ |
1ab5add6f4e8
patch 8.2.4925: trailing backslash may cause reading past end of line
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
210 sil! norm i"\ |
1ab5add6f4e8
patch 8.2.4925: trailing backslash may cause reading past end of line
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
211 call assert_equal('"\', getline(1)) |
1ab5add6f4e8
patch 8.2.4925: trailing backslash may cause reading past end of line
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
212 |
1ab5add6f4e8
patch 8.2.4925: trailing backslash may cause reading past end of line
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
213 bwipe! |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
214 endfor |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
215 |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
216 set enc=utf-8 |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
217 endfunc |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
218 |
14554
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
219 func Test_empty_html_tag() |
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
220 new |
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
221 call setline(1, '<div></div>') |
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
222 normal 0citxxx |
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
223 call assert_equal('<div>xxx</div>', getline(1)) |
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
224 |
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
225 call setline(1, '<div></div>') |
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
226 normal 0f<cityyy |
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
227 call assert_equal('<div>yyy</div>', getline(1)) |
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
228 |
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
229 call setline(1, '<div></div>') |
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
230 normal 0f<vitsaaa |
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
231 call assert_equal('aaa', getline(1)) |
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
232 |
26211
485c7c4afeb7
patch 8.2.3637: typos in test files
Bram Moolenaar <Bram@vim.org>
parents:
25725
diff
changeset
|
233 " selecting a tag block in a non-empty blank line should fail |
20199
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
234 call setline(1, ' ') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
235 call assert_beeps('normal $vaty') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
236 |
14554
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
237 bwipe! |
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
238 endfunc |
e7f92d1a3fcd
patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents:
14131
diff
changeset
|
239 |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
240 " Tests for match() and matchstr() |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
241 func Test_match() |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
242 call assert_equal("b", matchstr("abcd", ".", 0, 2)) |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
243 call assert_equal("bc", matchstr("abcd", "..", 0, 2)) |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
244 call assert_equal("c", matchstr("abcd", ".", 2, 0)) |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
245 call assert_equal("a", matchstr("abcd", ".", 0, -1)) |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
246 call assert_equal(-1, match("abcd", ".", 0, 5)) |
21552
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
247 call assert_equal(0, match("abcd", ".", 0, -1)) |
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
248 call assert_equal(0, match('abc', '.', 0, 1)) |
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
249 call assert_equal(1, match('abc', '.', 0, 2)) |
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
250 call assert_equal(2, match('abc', '.', 0, 3)) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
251 call assert_equal(-1, match('abc', '.', 0, 4)) |
21552
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
252 call assert_equal(1, match('abc', '.', 1, 1)) |
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
253 call assert_equal(2, match('abc', '.', 2, 1)) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
254 call assert_equal(-1, match('abc', '.', 3, 1)) |
21552
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
255 call assert_equal(3, match('abc', '$', 0, 1)) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
256 call assert_equal(-1, match('abc', '$', 0, 2)) |
21552
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
257 call assert_equal(3, match('abc', '$', 1, 1)) |
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
258 call assert_equal(3, match('abc', '$', 2, 1)) |
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
259 call assert_equal(3, match('abc', '$', 3, 1)) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
260 call assert_equal(-1, match('abc', '$', 4, 1)) |
21552
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
261 call assert_equal(0, match('abc', '\zs', 0, 1)) |
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
262 call assert_equal(1, match('abc', '\zs', 0, 2)) |
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
263 call assert_equal(2, match('abc', '\zs', 0, 3)) |
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
264 call assert_equal(3, match('abc', '\zs', 0, 4)) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
265 call assert_equal(-1, match('abc', '\zs', 0, 5)) |
21552
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
266 call assert_equal(1, match('abc', '\zs', 1, 1)) |
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
267 call assert_equal(2, match('abc', '\zs', 2, 1)) |
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
20895
diff
changeset
|
268 call assert_equal(3, match('abc', '\zs', 3, 1)) |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
269 call assert_equal(-1, match('abc', '\zs', 4, 1)) |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
11478
diff
changeset
|
270 endfunc |
13223
e37327129859
patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
271 |
e37327129859
patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
272 " This was causing an illegal memory access |
e37327129859
patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
273 func Test_inner_tag() |
e37327129859
patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
274 new |
e37327129859
patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
275 norm ixxx |
e37327129859
patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
276 call feedkeys("v", 'xt') |
e37327129859
patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
277 insert |
e37327129859
patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
278 x |
e37327129859
patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
279 x |
e37327129859
patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
280 . |
e37327129859
patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
281 norm it |
e37327129859
patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
282 q! |
e37327129859
patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
283 endfunc |
14131
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
284 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
285 func Test_sentence() |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
286 enew! |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
287 call setline(1, 'A sentence. A sentence? A sentence!') |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
288 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
289 normal yis |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
290 call assert_equal('A sentence.', @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
291 normal yas |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
292 call assert_equal('A sentence. ', @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
293 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
294 normal ) |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
295 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
296 normal yis |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
297 call assert_equal('A sentence?', @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
298 normal yas |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
299 call assert_equal('A sentence? ', @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
300 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
301 normal ) |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
302 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
303 normal yis |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
304 call assert_equal('A sentence!', @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
305 normal yas |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
306 call assert_equal(' A sentence!', @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
307 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
308 normal 0 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
309 normal 2yis |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
310 call assert_equal('A sentence. ', @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
311 normal 3yis |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
312 call assert_equal('A sentence. A sentence?', @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
313 normal 2yas |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
314 call assert_equal('A sentence. A sentence? ', @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
315 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
316 %delete _ |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
317 endfunc |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
318 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
319 func Test_sentence_with_quotes() |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
320 enew! |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
321 call setline(1, 'A "sentence." A sentence.') |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
322 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
323 normal yis |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
324 call assert_equal('A "sentence."', @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
325 normal yas |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
326 call assert_equal('A "sentence." ', @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
327 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
328 normal ) |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
329 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
330 normal yis |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
331 call assert_equal('A sentence.', @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
332 normal yas |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
333 call assert_equal(' A sentence.', @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
334 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
335 %delete _ |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
336 endfunc |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
337 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
14554
diff
changeset
|
338 func Test_sentence_with_cursor_on_delimiter() |
14131
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
339 enew! |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
340 call setline(1, "A '([sentence.])' A sentence.") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
341 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
342 normal! 15|yis |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
343 call assert_equal("A '([sentence.])'", @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
344 normal! 15|yas |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
345 call assert_equal("A '([sentence.])' ", @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
346 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
347 normal! 16|yis |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
348 call assert_equal("A '([sentence.])'", @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
349 normal! 16|yas |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
350 call assert_equal("A '([sentence.])' ", @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
351 |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
352 normal! 17|yis |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
353 call assert_equal("A '([sentence.])'", @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
354 normal! 17|yas |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
355 call assert_equal("A '([sentence.])' ", @") |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
356 |
20895
56c86b167b68
patch 8.2.0999: moving to next sentence gets stuck on quote
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
357 " don't get stuck on a quote at the start of a sentence |
56c86b167b68
patch 8.2.0999: moving to next sentence gets stuck on quote
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
358 %delete _ |
56c86b167b68
patch 8.2.0999: moving to next sentence gets stuck on quote
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
359 call setline(1, ['A sentence.', '"A sentence"?', 'A sentence!']) |
56c86b167b68
patch 8.2.0999: moving to next sentence gets stuck on quote
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
360 normal gg)) |
56c86b167b68
patch 8.2.0999: moving to next sentence gets stuck on quote
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
361 call assert_equal(3, getcurpos()[1]) |
56c86b167b68
patch 8.2.0999: moving to next sentence gets stuck on quote
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
362 |
56c86b167b68
patch 8.2.0999: moving to next sentence gets stuck on quote
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
363 %delete _ |
56c86b167b68
patch 8.2.0999: moving to next sentence gets stuck on quote
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
364 call setline(1, ['A sentence.', "'A sentence'?", 'A sentence!']) |
56c86b167b68
patch 8.2.0999: moving to next sentence gets stuck on quote
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
365 normal gg)) |
56c86b167b68
patch 8.2.0999: moving to next sentence gets stuck on quote
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
366 call assert_equal(3, getcurpos()[1]) |
56c86b167b68
patch 8.2.0999: moving to next sentence gets stuck on quote
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
367 |
14131
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
368 %delete _ |
ec85acd49b8e
patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents:
13223
diff
changeset
|
369 endfunc |
20199
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
370 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
371 " Test for the paragraph (ap) text object |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
372 func Test_paragraph() |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
373 new |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
374 call setline(1, ['First line.', 'Second line.', 'Third line.']) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
375 call cursor(2, 1) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
376 normal vapy |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
377 call assert_equal("First line.\nSecond line.\nThird line.\n", @") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
378 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
379 call cursor(2, 1) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
380 call assert_beeps('normal vapapy') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
381 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
382 call setline(1, ['First line.', 'Second line.', ' ', '']) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
383 call cursor(1, 1) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
384 normal vapy |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
385 call assert_equal("First line.\nSecond line.\n \n\n", @") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
386 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
387 call setline(1, ['', '', '', 'First line.', 'Second line.']) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
388 call cursor(2, 1) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
389 normal yap |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
390 call assert_equal("\n\n\nFirst line.\nSecond line.\n", @") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
391 call assert_beeps('normal 3yap') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
392 exe "normal \<C-C>" |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
393 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
394 %d |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
395 call setline(1, [' ', ' ', ' ']) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
396 call cursor(2, 1) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
397 normal Vipy |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
398 call assert_equal(" \n \n \n", @") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
399 call cursor(2, 1) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
400 call assert_beeps("normal Vipip") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
401 exe "normal \<C-C>" |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
402 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
403 close! |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
404 endfunc |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
405 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
406 " Tests for text object aw |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
407 func Test_textobj_a_word() |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
408 new |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
409 call append(0, ['foobar,eins,foobar', 'foo,zwei,foo ']) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
410 " diw |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
411 norm! 1gg0diw |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
412 call assert_equal([',eins,foobar', 'foo,zwei,foo ', ''], getline(1,'$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
413 " daw |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
414 norm! 2ggEdaw |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
415 call assert_equal([',eins,foobar', 'foo,zwei,', ''], getline(1, '$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
416 " daw the last word in a line |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
417 call setline(1, ['foo bar', 'foo bar', '']) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
418 call cursor(1, 5) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
419 normal daw |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
420 call assert_equal('foo', getline(1)) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
421 " aw in visual mode |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
422 call cursor(2, 5) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
423 normal! vawx |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
424 call assert_equal('foo', getline(2)) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
425 %d |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
426 call append(0, ["foo\teins\tfoobar", "foo\tzwei\tfoo "]) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
427 " diW |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
428 norm! 2ggwd2iW |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
429 call assert_equal(['foo eins foobar', 'foo foo ', ''], getline(1,'$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
430 " daW |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
431 norm! 1ggd2aW |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
432 call assert_equal(['foobar', 'foo foo ', ''], getline(1,'$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
433 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
434 %d |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
435 call append(0, ["foo\teins\tfoobar", "foo\tzwei\tfoo "]) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
436 " aw in visual line mode switches to characterwise mode |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
437 norm! 2gg$Vawd |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
438 call assert_equal(['foo eins foobar', 'foo zwei foo'], getline(1,'$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
439 norm! 1gg$Viwd |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
440 call assert_equal(['foo eins ', 'foo zwei foo'], getline(1,'$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
441 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
442 " visually selecting a tab before a word with 'selection' set to 'exclusive' |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
443 set selection=exclusive |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
444 normal gg3lvlawy |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
445 call assert_equal("\teins", @") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
446 " visually selecting a tab before a word with 'selection' set to 'inclusive' |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
447 set selection=inclusive |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
448 normal gg3lvlawy |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
449 call assert_equal("\teins\t", @") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
450 set selection& |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
451 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
452 " selecting a word with no non-space characters in a buffer fails |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
453 %d |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
454 call setline(1, ' ') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
455 call assert_beeps('normal 3lyaw') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
456 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
457 " visually selecting words backwards with no more words to select |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
458 call setline(1, 'one two') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
459 call assert_beeps('normal 2lvh2aw') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
460 exe "normal \<C-C>" |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
461 call assert_beeps('normal $vh3aw') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
462 exe "normal \<C-C>" |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
463 call setline(1, ['', 'one two']) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
464 call assert_beeps('normal 2G2lvh3aw') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
465 exe "normal \<C-C>" |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
466 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
467 " selecting words forward with no more words to select |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
468 %d |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
469 call setline(1, 'one a') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
470 call assert_beeps('normal 0y3aw') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
471 call setline(1, 'one two ') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
472 call assert_beeps('normal 0y3aw') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
473 call assert_beeps('normal 03ly2aw') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
474 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
475 " clean up |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
476 bw! |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
477 endfunc |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
478 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
479 " Test for is and as text objects |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
480 func Test_textobj_sentence() |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
481 new |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
482 call append(0, ['This is a test. With some sentences!', '', |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
483 \ 'Even with a question? And one more. And no sentence here']) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
484 " Test for dis - does not remove trailing whitespace |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
485 norm! 1gg0dis |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
486 call assert_equal([' With some sentences!', '', |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
487 \ 'Even with a question? And one more. And no sentence here', ''], |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
488 \ getline(1,'$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
489 " Test for das - removes leading whitespace |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
490 norm! 3ggf?ldas |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
491 call assert_equal([' With some sentences!', '', |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
492 \ 'Even with a question? And no sentence here', ''], getline(1,'$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
493 " when used in visual mode, is made characterwise |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
494 norm! 3gg$Visy |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
495 call assert_equal('v', visualmode()) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
496 " reset visualmode() |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
497 norm! 3ggVy |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
498 norm! 3gg$Vasy |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
499 call assert_equal('v', visualmode()) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
500 " basic testing for textobjects a< and at |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
501 %d |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
502 call setline(1, ['<div> ','<a href="foobar" class="foo">xyz</a>',' </div>', ' ']) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
503 " a< |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
504 norm! 1gg0da< |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
505 call assert_equal([' ', '<a href="foobar" class="foo">xyz</a>', ' </div>', ' '], getline(1,'$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
506 norm! 1pj |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
507 call assert_equal([' <div>', '<a href="foobar" class="foo">xyz</a>', ' </div>', ' '], getline(1,'$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
508 " at |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
509 norm! d2at |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
510 call assert_equal([' '], getline(1,'$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
511 %d |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
512 call setline(1, ['<div> ','<a href="foobar" class="foo">xyz</a>',' </div>', ' ']) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
513 " i< |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
514 norm! 1gg0di< |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
515 call assert_equal(['<> ', '<a href="foobar" class="foo">xyz</a>', ' </div>', ' '], getline(1,'$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
516 norm! 1Pj |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
517 call assert_equal(['<div> ', '<a href="foobar" class="foo">xyz</a>', ' </div>', ' '], getline(1,'$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
518 norm! d2it |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
519 call assert_equal(['<div></div>',' '], getline(1,'$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
520 " basic testing for a[ and i[ text object |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
521 %d |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
522 call setline(1, [' ', '[', 'one [two]', 'thre', ']']) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
523 norm! 3gg0di[ |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
524 call assert_equal([' ', '[', ']'], getline(1,'$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
525 call setline(1, [' ', '[', 'one [two]', 'thre', ']']) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
526 norm! 3gg0ftd2a[ |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
527 call assert_equal([' '], getline(1,'$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
528 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
529 " clean up |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
530 bw! |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
531 endfunc |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
532 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
533 " Test for quote (', " and `) textobjects |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
534 func Test_textobj_quote() |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
535 new |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
536 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
537 " Test for i" when cursor is in front of a quoted object |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
538 call append(0, 'foo "bar"') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
539 norm! 1gg0di" |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
540 call assert_equal(['foo ""', ''], getline(1,'$')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
541 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
542 " Test for visually selecting an inner quote |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
543 %d |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
544 " extend visual selection from one quote to the next |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
545 call setline(1, 'color "red" color "blue"') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
546 call cursor(1, 7) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
547 normal v4li"y |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
548 call assert_equal('"red" color "blue', @") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
549 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
550 " try to extend visual selection from one quote to a non-existing quote |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
551 call setline(1, 'color "red" color blue') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
552 call cursor(1, 7) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
553 call feedkeys('v4li"y', 'xt') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
554 call assert_equal('"red"', @") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
555 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
556 " try to extend visual selection from one quote to a next partial quote |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
557 call setline(1, 'color "red" color "blue') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
558 call cursor(1, 7) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
559 normal v4li"y |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
560 call assert_equal('"red" color ', @") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
561 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
562 " select a quote backwards in visual mode |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
563 call cursor(1, 12) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
564 normal vhi"y |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
565 call assert_equal('red" ', @") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
566 call assert_equal(8, col('.')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
567 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
568 " select a quote backwards in visual mode from outside the quote |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
569 call cursor(1, 17) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
570 normal v2hi"y |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
571 call assert_equal('red', @") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
572 call assert_equal(8, col('.')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
573 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
574 " visually selecting a quote with 'selection' set to 'exclusive' |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
575 call setline(1, 'He said "How are you?"') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
576 set selection=exclusive |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
577 normal 012lv2li"y |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
578 call assert_equal('How are you?', @") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
579 set selection& |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
580 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
581 " try copy a quote object with a single quote in the line |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
582 call setline(1, "Smith's car") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
583 call cursor(1, 6) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
584 call assert_beeps("normal yi'") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
585 call assert_beeps("normal 2lyi'") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
586 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
587 " selecting space before and after a quoted string |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
588 call setline(1, "some 'special' string") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
589 normal 0ya' |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
590 call assert_equal("'special' ", @") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
591 call setline(1, "some 'special'string") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
592 normal 0ya' |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
593 call assert_equal(" 'special'", @") |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
594 |
25725
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
595 " quoted string with odd or even number of backslashes. |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
596 call setline(1, 'char *s = "foo\"bar"') |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
597 normal $hhyi" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
598 call assert_equal('foo\"bar', @") |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
599 call setline(1, 'char *s = "foo\\"bar"') |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
600 normal $hhyi" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
601 call assert_equal('bar', @") |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
602 call setline(1, 'char *s = "foo\\\"bar"') |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
603 normal $hhyi" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
604 call assert_equal('foo\\\"bar', @") |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
605 call setline(1, 'char *s = "foo\\\\"bar"') |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
606 normal $hhyi" |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
607 call assert_equal('bar', @") |
2dd3007f902d
patch 8.2.3398: html text objects are not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
25437
diff
changeset
|
608 |
20199
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
609 close! |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
610 endfunc |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
611 |
25437
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
612 " Test for i(, i<, etc. when cursor is in front of a block |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
613 func Test_textobj_find_paren_forward() |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
614 new |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
615 |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
616 " i< and a> when cursor is in front of a block |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
617 call setline(1, '#include <foo.h>') |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
618 normal 0yi< |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
619 call assert_equal('foo.h', @") |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
620 normal 0ya> |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
621 call assert_equal('<foo.h>', @") |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
622 |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
623 " 2i(, 3i( in front of a block enters second/third nested '(' |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
624 call setline(1, 'foo (bar (baz (quux)))') |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
625 normal 0yi) |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
626 call assert_equal('bar (baz (quux))', @") |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
627 normal 02yi) |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
628 call assert_equal('baz (quux)', @") |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
629 normal 03yi) |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
630 call assert_equal('quux', @") |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
631 |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
632 " 3i( in front of a block doesn't enter third but un-nested '(' |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
633 call setline(1, 'foo (bar (baz) (quux))') |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
634 normal 03di) |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
635 call assert_equal('foo (bar (baz) (quux))', getline(1)) |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
636 normal 02di) |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
637 call assert_equal('foo (bar () (quux))', getline(1)) |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
638 normal 0di) |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
639 call assert_equal('foo ()', getline(1)) |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
640 |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
641 close! |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
642 endfunc |
d4a710f06f02
patch 8.2.3255: ci" finds following string but ci< and others don't
Bram Moolenaar <Bram@vim.org>
parents:
22604
diff
changeset
|
643 |
20199
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18677
diff
changeset
|
644 " vim: shiftwidth=2 sts=2 expandtab |