Skip to content

Commit

Permalink
updated for version 7.3.235
Browse files Browse the repository at this point in the history
Problem:    ";" gets stuck on a "t" command, it's not useful.
Solution:   Add the ';' flag in 'cpo'. (Christian Brabandt)
  • Loading branch information
brammool committed Jun 26, 2011
1 parent deef077 commit beda110
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 14 deletions.
4 changes: 2 additions & 2 deletions runtime/doc/motion.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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*
Expand Down
6 changes: 6 additions & 0 deletions runtime/doc/options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
6 changes: 4 additions & 2 deletions src/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,12 @@
#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<>[],~"
Expand Down
15 changes: 12 additions & 3 deletions src/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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;
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/testdir/Make_amiga.mak
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -128,3 +129,4 @@ test77.out: test77.in
test78.out: test78.in
test79.out: test79.in
test80.out: test80.in
test81.out: test81.in
2 changes: 1 addition & 1 deletion src/testdir/Make_dos.mak
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/testdir/Make_ming.mak
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion src/testdir/Make_os2.mak
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/testdir/Make_vms.mms
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/testdir/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 18 additions & 0 deletions src/testdir/test81.in
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions src/testdir/test81.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
aaa two
bbb y
ccc
ddd yee y
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
235,
/**/
234,
/**/
Expand Down

0 comments on commit beda110

Please sign in to comment.