]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.235 v7.3.235
authorBram Moolenaar <Bram@vim.org>
Sun, 26 Jun 2011 03:36:34 +0000 (05:36 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 26 Jun 2011 03:36:34 +0000 (05:36 +0200)
Problem:    ";" gets stuck on a "t" command, it's not useful.
Solution:   Add the ';' flag in 'cpo'. (Christian Brabandt)

13 files changed:
runtime/doc/motion.txt
runtime/doc/options.txt
src/option.h
src/search.c
src/testdir/Make_amiga.mak
src/testdir/Make_dos.mak
src/testdir/Make_ming.mak
src/testdir/Make_os2.mak
src/testdir/Make_vms.mms
src/testdir/Makefile
src/testdir/test81.in [new file with mode: 0644]
src/testdir/test81.ok [new file with mode: 0644]
src/version.c

index d8a8906223e8392a3634a4b9c85c5aa117566edc..2f635bc48b28c42f7aa14ac42c2ee468187b5ef2 100644 (file)
@@ -269,11 +269,11 @@ T{char}                   Till after [count]'th occurrence of {char} to the
                        {char} can be entered like with the |f| command.
 
                                                        *;*
-;                      Repeat latest f, t, F or T [count] times.
+;                      Repeat latest f, t, F or T [count] times. See |cpo-;|
 
                                                        *,*
 ,                      Repeat latest f, t, F or T in opposite direction
-                       [count] times.
+                       [count] times. See also |cpo-;|
 
 ==============================================================================
 3. Up-down motions                                     *up-down-motions*
index 91623c10fe6bdc656aebd18174f520975645e547..7d8f9262032184f5ca7b696ebda743e10874f153 100644 (file)
@@ -2117,6 +2117,12 @@ A jump table for the options with a short description can be found at |Q_op|.
                                                                *cpo->*
                >       When appending to a register, put a line break before
                        the appended text.
+                                                               *cpo-;*
+               ;       When using |,| or |;| to repeat the last |t| search
+                       and the cursor is right in front of the searched
+                       character, the cursor won't move. When not included,
+                       the cursor would skip over it and jump to the
+                       following occurence.
 
        POSIX flags.  These are not included in the Vi default value, except
        when $VIM_POSIX was set on startup. |posix|
index b7f1bd9f4b7609f255ae1572a13cdcea91021f7a..c47b143c0ff02a99c8b1c7f8c0326a130481c912 100644 (file)
 #define CPO_SUBPERCENT '/'     /* % in :s string uses previous one */
 #define CPO_BACKSL     '\\'    /* \ is not special in [] */
 #define CPO_CHDIR      '.'     /* don't chdir if buffer is modified */
+#define CPO_SCOLON     ';'     /* using "," and ";" will skip over char if
+                                * cursor would not move */
 /* default values for Vim, Vi and POSIX */
 #define CPO_VIM                "aABceFs"
-#define CPO_VI         "aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>"
-#define CPO_ALL                "aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>#{|&/\\."
+#define CPO_VI         "aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>;"
+#define CPO_ALL                "aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>#{|&/\\.;"
 
 /* characters for p_ww option: */
 #define WW_ALL         "bshl<>[],~"
index acd4c8da4e8c2bd694a46c19a625f4ef1cf8cfc0..6c9e1dae9183b253ceb57a1472c1c4ac6b900f4a 100644 (file)
@@ -1546,6 +1546,7 @@ searchc(cap, t_cmd)
     int                        col;
     char_u             *p;
     int                        len;
+    int                        stop = TRUE;
 #ifdef FEAT_MBYTE
     static char_u      bytes[MB_MAXBYTES];
     static int         bytelen = 1;    /* >1 for multi-byte char */
@@ -1580,6 +1581,12 @@ searchc(cap, t_cmd)
        t_cmd = last_t_cmd;
        c = lastc;
        /* For multi-byte re-use last bytes[] and bytelen. */
+
+       /* Force a move of at least one char, so ";" and "," will move the
+        * cursor, even if the cursor is right in front of char we are looking
+        * at. */
+       if (vim_strchr(p_cpo, CPO_SCOLON) == NULL && count == 1)
+           stop = FALSE;
     }
 
     if (dir == BACKWARD)
@@ -1612,14 +1619,15 @@ searchc(cap, t_cmd)
                }
                if (bytelen == 1)
                {
-                   if (p[col] == c)
+                   if (p[col] == c && stop)
                        break;
                }
                else
                {
-                   if (vim_memcmp(p + col, bytes, bytelen) == 0)
+                   if (vim_memcmp(p + col, bytes, bytelen) == 0 && stop)
                        break;
                }
+               stop = TRUE;
            }
        }
        else
@@ -1629,8 +1637,9 @@ searchc(cap, t_cmd)
            {
                if ((col += dir) < 0 || col >= len)
                    return FAIL;
-               if (p[col] == c)
+               if (p[col] == c && stop)
                    break;
+               stop = TRUE;
            }
        }
     }
index e9c30c450e8c57ef6ae5db02cdf3db0b4c8ffe28..f3035b18fc0b4d1a9a73d664a3fe26609902ce87 100644 (file)
@@ -28,7 +28,8 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
                test61.out test62.out test63.out test64.out test65.out \
                test66.out test67.out test68.out test69.out test70.out \
                test71.out test72.out test73.out test74.out test75.out \
-               test76.out test77.out test78.out test79.out test80.out
+               test76.out test77.out test78.out test79.out test80.out \
+               test81.out
 
 .SUFFIXES: .in .out
 
@@ -128,3 +129,4 @@ test77.out: test77.in
 test78.out: test78.in
 test79.out: test79.in
 test80.out: test80.in
+test81.out: test81.in
index e6b5ff2e0c90b911bbcd2c59e2675adadabf1bb9..9ece4b5179ef94a3b2f76cf2750bc9e371b607f7 100644 (file)
@@ -29,7 +29,7 @@ SCRIPTS =     test3.out test4.out test5.out test6.out test7.out \
                test42.out test52.out test65.out test66.out test67.out \
                test68.out test69.out test71.out test72.out test73.out \
                test74.out test75.out test76.out test77.out test78.out \
-               test79.out test80.out
+               test79.out test80.out test81.out
 
 SCRIPTS32 =    test50.out test70.out
 
index e7528259d73c7798fb35aa20410b502e1bfe04e8..2ff20ad1b24a3e9c5e15e76c490509c4dc7b6e5b 100644 (file)
@@ -49,7 +49,7 @@ SCRIPTS =     test3.out test4.out test5.out test6.out test7.out \
                test42.out test52.out test65.out test66.out test67.out \
                test68.out test69.out test71.out test72.out test73.out \
                test74.out test75.out test76.out test77.out test78.out \
-               test79.out test80.out
+               test79.out test80.out test81.out
 
 SCRIPTS32 =    test50.out test70.out
 
index a80dff5deae148225884d5a983b3ce9d0fbedc0e..4442a41de09b7b2892c69f4ef1af46de898373ac 100644 (file)
@@ -28,7 +28,8 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
                test61.out test62.out test63.out test64.out test65.out \
                test66.out test67.out test68.out test69.out test70.out \
                test71.out test72.out test73.out test74.out test75.out \
-               test76.out test77.out test78.out test79.out test80.out
+               test76.out test77.out test78.out test79.out test80.out \
+               test81.out
 
 .SUFFIXES: .in .out
 
index 58ab4e8129d4ca416c9c67faeff9ee9aa05023ca..d4101ed9591c42f60256e052a08cff576d15d29b 100644 (file)
@@ -4,7 +4,7 @@
 # Authors:     Zoltan Arpadffy, <arpadffy@polarhome.com>
 #              Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
 #
-# Last change:  2011 Jun 19
+# Last change:  2011 Jun 26
 #
 # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
 # Edit the lines in the Configuration section below to select.
@@ -75,7 +75,7 @@ SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
         test61.out test62.out test63.out test64.out test65.out \
         test66.out test67.out test68.out test69.out \
         test71.out test72.out test74.out test75.out test76.out \
-        test77.out test78.out test79.out test80.out
+        test77.out test78.out test79.out test80.out test81.out
 
 # Known problems:
 # Test 30: a problem around mac format - unknown reason
index 85610162739fb5ae16b16ee67e91d382c1c9ad3e..2eea86e26514f01d0ec7a8c112ceb09f965c0ae4 100644 (file)
@@ -26,7 +26,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
                test64.out test65.out test66.out test67.out test68.out \
                test69.out test70.out test71.out test72.out test73.out \
                test74.out test75.out test76.out test77.out test78.out \
-               test79.out test80.out
+               test79.out test80.out test81.out
 
 SCRIPTS_GUI = test16.out
 
diff --git a/src/testdir/test81.in b/src/testdir/test81.in
new file mode 100644 (file)
index 0000000..e47653f
--- /dev/null
@@ -0,0 +1,18 @@
+Test for t movement command and 'cpo-;' setting
+
+STARTTEST
+:set nocompatible
+:set cpo-=;
+/firstline/
+j0tt;D
+$Ty;D:set cpo+=;
+j0tt;;D
+$Ty;;D:?firstline?+1,$w! test.out
+:qa!
+ENDTEST
+
+firstline
+aaa two three four
+bbb yee yoo four
+ccc two three four
+ddd yee yoo four
diff --git a/src/testdir/test81.ok b/src/testdir/test81.ok
new file mode 100644 (file)
index 0000000..8f86b52
--- /dev/null
@@ -0,0 +1,4 @@
+aaa two
+bbb y
+ccc
+ddd yee y
index ccb59a02ad8df2fc527c0624294170c9bd78782f..d76c4b3dfd9509acabf2fa21ed8258dc2f36a962 100644 (file)
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    235,
 /**/
     234,
 /**/