File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 21
21
(with-vi-buffer (#?" [p]en pineapple apple pen\n apple juice\n pineapple cake\n " )
22
22
(cmd " Vj" )
23
23
(ex-cmd " '<,'>s/apple/grape" )
24
- (ok (text= #?" pen pinegrape apple pen\n grape juice\n pineapple cake\n " ))))
24
+ (ok (text= #?" pen pinegrape apple pen\n grape juice\n pineapple cake\n " )))
25
+
26
+ ; ; Regexp Replacements
27
+ (with-vi-buffer (#?" line 1\n l[i]ne 2\n line 3\n line 4\n " )
28
+ (cmd " Vj" )
29
+ (ex-cmd " '<,'>s/^/foo - /" )
30
+ (ok (text= #?" line 1\n foo - line 2\n foo - line 3\n line 4\n " )))
31
+ (with-vi-buffer (#?" line 1\n l[i]ne 2\n line 3\n line 4\n " )
32
+ (cmd " Vj" )
33
+ (ex-cmd " '<,'>s/$/ - bar/" )
34
+ (ok (text= #?" line 1\n line 2 - bar\n line 3 - bar\n line 4\n " )))
35
+ )
25
36
(testing " 'g' flag"
26
37
(with-vi-buffer (#?" pen pineapple <apple pen\n ap[p]>le juice\n pineapple cake\n " )
27
38
(ex-cmd " '<,'>s/apple/grape/g" )
Original file line number Diff line number Diff line change 187
187
(return-from highlight-region nil ))
188
188
(with-point ((p start-point))
189
189
(loop
190
- (unless (funcall *isearch-search-forward-function* p search-string end-point)
191
- (return ))
192
- (with-point ((before p))
193
- (funcall *isearch-search-backward-function* before search-string)
194
- (isearch-add-overlay buffer
195
- (make-overlay before p ' isearch-highlight-attribute)))))
190
+ (unless (or (funcall *isearch-search-forward-function* p search-string end-point)
191
+ (point= start-point end-point)))
192
+ (return ))
193
+ (with-point ((before p))
194
+ (funcall *isearch-search-backward-function* before search-string)
195
+ (isearch-add-overlay buffer
196
+ (make-overlay before p ' isearch-highlight-attribute))))
196
197
(isearch-sort-overlays buffer))))
197
198
198
199
(defun isearch-update-display ()
You can’t perform that action at this time.
0 commit comments