File tree Expand file tree Collapse file tree 3 files changed +38
-6
lines changed Expand file tree Collapse file tree 3 files changed +38
-6
lines changed Original file line number Diff line number Diff line change @@ -814,8 +814,11 @@ Returns the line number of the match."
814
814
(save-excursion
815
815
(set-text-properties 0 (length pattern) nil pattern)
816
816
(evil-move-end-of-line)
817
- (and (re-search-forward pattern nil t )
818
- (line-number-at-pos (1- (match-end 0 ))))))
817
+ (if (re-search-forward pattern nil t )
818
+ (line-number-at-pos (1- (match-end 0 )))
819
+ (goto-char (point-min ))
820
+ (and (re-search-forward pattern nil t )
821
+ (line-number-at-pos (1- (match-end 0 )))))))
819
822
(invalid-regexp
820
823
(evil-ex-echo (cadr err))
821
824
nil )))
@@ -828,8 +831,11 @@ Returns the line number of the match."
828
831
(save-excursion
829
832
(set-text-properties 0 (length pattern) nil pattern)
830
833
(evil-move-beginning-of-line)
831
- (and (re-search-backward pattern nil t )
832
- (line-number-at-pos (match-beginning 0 )))))
834
+ (if (re-search-backward pattern nil t )
835
+ (line-number-at-pos (match-beginning 0 ))
836
+ (goto-char (point-max ))
837
+ (and (re-search-backward pattern nil t )
838
+ (line-number-at-pos (match-beginning 0 ))))))
833
839
(invalid-regexp
834
840
(evil-ex-echo (cadr err))
835
841
nil )))
Original file line number Diff line number Diff line change @@ -7846,7 +7846,33 @@ maybe we need one line more with some text\n")
7846
7846
(evil-test-buffer
7847
7847
"line1\nline2\nline3\nli[n]e4\nline5\n"
7848
7848
(":2,4move.")
7849
- "line1\nline2\nline3\n[l]ine4\nline5\n")))
7849
+ "line1\nline2\nline3\n[l]ine4\nline5\n"))
7850
+ (ert-info ("Move to backwards line, searching forwards (wrapping around)")
7851
+ (evil-test-buffer
7852
+ "
7853
+ Target
7854
+ Other line
7855
+ [S]ource
7856
+ "
7857
+ (":move/Target/")
7858
+ "
7859
+ Target
7860
+ [S]ource
7861
+ Other line
7862
+ "))
7863
+ (ert-info ("Move to forwards line, searching backwards (wrapping around)")
7864
+ (evil-test-buffer
7865
+ "
7866
+ Target
7867
+ [O]ther line
7868
+ Source
7869
+ "
7870
+ (":move?Source?")
7871
+ "
7872
+ Target
7873
+ Source
7874
+ [O]ther line
7875
+ ")))
7850
7876
7851
7877
(ert-deftest evil-test-write ()
7852
7878
:tags '(evil ex)
Original file line number Diff line number Diff line change @@ -380,7 +380,7 @@ If visual state is inactive then those values are nil."
380
380
" Ex line number."
381
381
(list
382
382
(and (evil-ex-p)
383
- (let ((expr (evil-ex-parse evil-ex-argument)))
383
+ (let ((expr (evil-ex-parse evil-ex-argument)))
384
384
(if (eq (car expr) 'evil-goto-line )
385
385
(save-excursion
386
386
(goto-char evil-ex-point)
You can’t perform that action at this time.
0 commit comments