aboutsummaryrefslogtreecommitdiff
path: root/evil-tests.el
diff options
context:
space:
mode:
authorJustin Burkett <justin@burkett.cc>2017-05-03 10:02:41 -0400
committerJustin Burkett <justin@burkett.cc>2017-05-04 17:07:27 -0400
commit6a5ea185775900fd28a62f3c374f412aa832f5a0 (patch)
tree59a59d0f6382621801c74e9da64d90560ff25d36 /evil-tests.el
parentf0684c1f6644a8c4e0e5fce50a1a04796555eaf1 (diff)
Fix evil-search-next when search string is newline
When the search string is a newline and evil-move-beyond-eol is nil, point gets moved back an extra character after moving to the beginning of the matched character (the newline). evil-search-next then finds that same newline again and we get stuck. Add regression test. Fixes #823
Diffstat (limited to 'evil-tests.el')
-rw-r--r--evil-tests.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/evil-tests.el b/evil-tests.el
index 858d77a..de537d5 100644
--- a/evil-tests.el
+++ b/evil-tests.el
@@ -7225,7 +7225,18 @@ if no previous selection")
(error search-failed "n")
"foo foo foo\nbar [b]ar\nbaz baz baz\n"
(error search-failed "N")
- "foo foo foo\nbar [b]ar\nbaz baz baz\n"))))
+ "foo foo foo\nbar [b]ar\nbaz baz baz\n"))
+ (ert-info ("Test search for newline")
+ (evil-test-buffer
+ "[s]tart\nline 2\nline 3\n\n"
+ ("/\\n" [return])
+ "star[t]\nline 2\nline 3\n\n"
+ ("n")
+ "start\nline [2]\nline 3\n\n"
+ ("n")
+ "start\nline 2\nline [3]\n\n"
+ ("n")
+ "start\nline 2\nline 3\n[]\n"))))
(ert-deftest evil-test-ex-search-offset ()
"Test search offsets."