diff src/search.c @ 5523:6e54d1b3408c v7.4.110

updated for version 7.4.110 Problem: "gUgn" cannot be repeeated. (Dimitar Dimitrov) Solution: Don't put "gn" in a different order in the redo buffer. Restore 'wrapscan' when the pattern isn't found. (Christian Wellenbrock)
author Bram Moolenaar <bram@vim.org>
date Thu, 28 Nov 2013 19:27:30 +0100
parents 6ae816249627
children 15960ebc2ee8
line wrap: on
line diff
--- a/src/search.c
+++ b/src/search.c
@@ -4544,7 +4544,10 @@ current_search(count, forward)
     /* Is the pattern is zero-width? */
     one_char = is_one_char(spats[last_idx].pat);
     if (one_char == -1)
-	return FAIL;  /* invalid pattern */
+    {
+	p_ws = old_p_ws;
+	return FAIL;  /* pattern not found */
+    }
 
     /*
      * The trick is to first search backwards and then search forward again,