comparison src/testdir/test53.in @ 9647:847518911c0b v7.4.2100

commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 24 17:33:05 2016 +0200 patch 7.4.2100 Problem: "cgn" and "dgn" do not work correctly with a single character match and the replacement includes the searched pattern. (John Beckett) Solution: If the match is found in the wrong column try in the next column. Turn the test into new style. (Christian Brabandt)
author Christian Brabandt <cb@256bit.org>
date Sun, 24 Jul 2016 17:45:05 +0200
parents 950e24f26ef8
children
comparison
equal deleted inserted replaced
9646:c9c6aaff0184 9647:847518911c0b
1 Tests for string and html text objects. vim: set ft=vim : 1 Tests for string and html text objects. vim: set ft=vim :
2 2
3 Note that the end-of-line moves the cursor to the next test line. 3 Note that the end-of-line moves the cursor to the next test line.
4 4
5 Also test match() and matchstr() 5 Also test match() and matchstr()
6
7 Also test the gn command and repeating it.
8 6
9 STARTTEST 7 STARTTEST
10 :so small.vim 8 :so small.vim
11 /^start:/ 9 /^start:/
12 da" 10 da"
51 :put =match('abc', '\zs', 0, 5) " -1 49 :put =match('abc', '\zs', 0, 5) " -1
52 :put =match('abc', '\zs', 1, 1) " 1 50 :put =match('abc', '\zs', 1, 1) " 1
53 :put =match('abc', '\zs', 2, 1) " 2 51 :put =match('abc', '\zs', 2, 1) " 2
54 :put =match('abc', '\zs', 3, 1) " 3 52 :put =match('abc', '\zs', 3, 1) " 3
55 :put =match('abc', '\zs', 4, 1) " -1 53 :put =match('abc', '\zs', 4, 1) " -1
56 /^foobar
57 gncsearchmatch/one\_s*two\_s
58 :1
59 gnd
60 /[a]bcdx
61 :1
62 2gnd/join
63 /$
64 0gnd
65 /\>\zs
66 0gnd/^
67 gnd$h/\zs
68 gnd/[u]niquepattern/s
69 vlgnd
70 /mother
71 :set selection=exclusive
72 $cgNmongoose/i
73 cgnj
74 :" Make sure there is no other match y uppercase.
75 /x59
76 gggnd
77 :" test repeating dgn
78 /^Johnny
79 ggdgn.
80 :" test repeating gUgn
81 /^Depp
82 gggUgn.
83 gg/a:0\@!\zs\d\+
84 nygnop
85 :/^start:/,/^end:/wq! test.out 54 :/^start:/,/^end:/wq! test.out
86 ENDTEST 55 ENDTEST
87 56
88 start: "wo\"rd\\" foo 57 start: "wo\"rd\\" foo
89 'foo' 'bar' 'piep' 58 'foo' 'bar' 'piep'
101 -<b> 70 -<b>
102 innertext object 71 innertext object
103 </b> 72 </b>
104 </begin> 73 </begin>
105 SEARCH: 74 SEARCH:
106 foobar
107 one
108 two
109 abcdx | abcdx | abcdx
110 join
111 lines
112 zero width pattern
113 delete first and last chars
114 uniquepattern uniquepattern
115 my very excellent mother just served us nachos
116 for (i=0; i<=10; i++)
117 a:10
118
119 a:1
120
121 a:20
122 Y
123 text
124 Y
125 --1
126 Johnny
127 --2
128 Johnny
129 --3
130 Depp
131 --4
132 Depp
133 --5
134 end: 75 end: