]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.647 v7.3.647
authorBram Moolenaar <Bram@vim.org>
Wed, 5 Sep 2012 10:16:45 +0000 (12:16 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 5 Sep 2012 10:16:45 +0000 (12:16 +0200)
Problem:    "gnd" doesn't work correctly in Visual mode.
Solution:   Handle Visual mode differently in "gn". (Christian Brabandt)

src/search.c
src/testdir/test53.in
src/testdir/test53.ok
src/version.c

index b54b30f9e80d5959c94f0a265317472b4cbce2b9..158cfd8f5d92d7cf883b8a726ab1be71ff56602c 100644 (file)
@@ -4545,7 +4545,6 @@ current_search(count, forward)
     int                dir;
     int                result;         /* result of various function calls */
     char_u     old_p_ws = p_ws;
-    int                visual_active = FALSE;
     int                flags = 0;
     pos_T      save_VIsual;
     int                zerowidth = FALSE;
@@ -4561,11 +4560,6 @@ current_search(count, forward)
     {
        orig_pos = curwin->w_cursor;
        save_VIsual = VIsual;
-       visual_active = TRUE;
-
-       /* just started visual selection, only one character */
-       if (equalpos(VIsual, curwin->w_cursor))
-           visual_active = FALSE;
 
        pos = curwin->w_cursor;
        start_pos = VIsual;
@@ -4619,7 +4613,7 @@ current_search(count, forward)
            p_ws = old_p_ws;
            return FAIL;
        }
-       else if (!i && !result && !visual_active)
+       else if (!i && !result)
        {
            if (forward) /* try again from start of buffer */
            {
@@ -4691,7 +4685,8 @@ is_zerowidth(pattern)
     regmmatch_T        regmatch;
     int                nmatched = 0;
     int                result = -1;
-    pos_T       pos;
+    pos_T      pos;
+    int                save_called_emsg = called_emsg;
 
     if (search_regcomp(pattern, RE_SEARCH, RE_SEARCH,
                                              SEARCH_KEEP, &regmatch) == FAIL)
@@ -4704,15 +4699,17 @@ is_zerowidth(pattern)
     {
        /* Zero-width pattern should match somewhere, then we can check if
         * start and end are in the same position. */
+       called_emsg = FALSE;
        nmatched = vim_regexec_multi(&regmatch, curwin, curbuf,
                                                  pos.lnum, (colnr_T)0, NULL);
 
        if (!called_emsg)
            result = (nmatched != 0
-                   && regmatch.startpos[0].lnum == regmatch.endpos[0].lnum
-                   && regmatch.startpos[0].col == regmatch.endpos[0].col);
+               && regmatch.startpos[0].lnum == regmatch.endpos[0].lnum
+               && regmatch.startpos[0].col == regmatch.endpos[0].col);
     }
 
+    called_emsg |= save_called_emsg;
     vim_free(regmatch.regprog);
     return result;
 }
index be76b05c1cac5a2e552f76098b8f97f3384092d8..af617c01f1bc75b5cda27a61ca4c55b214ee4271 100644 (file)
@@ -40,7 +40,8 @@ gnd
 /\>\zs
 0gnd/^
 gnd$h/\zs
-gnd
+gnd/[u]niquepattern/s
+vlgnd
 :/^start:/,/^end:/wq! test.out
 ENDTEST
 
@@ -67,4 +68,5 @@ join
 lines
 zero width pattern
 delete first and last chars
+uniquepattern uniquepattern
 end:
index 928caff7c05b310064768bb5dc5404e7c781e526..0a2a6f4d194339e2a03ce0abee563c1b5c28a2dc 100644 (file)
@@ -24,4 +24,5 @@ abcdx |  | abcdx
 join lines
 zerowidth pattern
 elete first and last char
+ uniquepattern
 end:
index 2f20fa674d009303d89516300ad53670be4fe0a9..922e86544b4073211ea898c529731890c2f0467c 100644 (file)
@@ -719,6 +719,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    647,
 /**/
     646,
 /**/