From: Bram Moolenaar Date: Fri, 13 Mar 2015 14:03:00 +0000 (+0100) Subject: updated for version 7.4.662 X-Git-Tag: v7.4.662 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=438b64ab71cd724129c4eec840be16c52602ebc8;p=vim updated for version 7.4.662 Problem: When 'M' is in the 'cpo' option then selecting a text object in parenthesis does not work correctly. Solution: Keep 'M' in 'cpo' when finding a match. (Hirohito Higashi) --- diff --git a/src/search.c b/src/search.c index 8beacbbc3..7022870c4 100644 --- a/src/search.c +++ b/src/search.c @@ -3583,10 +3583,11 @@ current_block(oap, count, include, what, other) /* * Search backwards for unclosed '(', '{', etc.. * Put this position in start_pos. - * Ignore quotes here. + * Ignore quotes here. Keep the "M" flag in 'cpo', as that is what the + * user wants. */ save_cpo = p_cpo; - p_cpo = (char_u *)"%"; + p_cpo = (char_u *)(vim_strchr(p_cpo, CPO_MATCHBSL) != NULL ? "%M" : "%"); while (count-- > 0) { if ((pos = findmatch(NULL, what)) == NULL) diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak index 2567d52e7..cc4af8934 100644 --- a/src/testdir/Make_amiga.mak +++ b/src/testdir/Make_amiga.mak @@ -53,6 +53,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test_options.out \ test_qf_title.out \ test_signs.out \ + test_textobjects.out \ test_utf8.out .SUFFIXES: .in .out @@ -194,4 +195,5 @@ test_nested_function.out: test_nested_function.in test_options.out: test_options.in test_qf_title.out: test_qf_title.in test_signs.out: test_signs.in +test_textobjects.out: test_textobjects.in test_utf8.out: test_utf8.in diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak index 4b17f96f4..fcd81b54d 100644 --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -52,6 +52,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test_options.out \ test_qf_title.out \ test_signs.out \ + test_textobjects.out \ test_utf8.out SCRIPTS32 = test50.out test70.out diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak index a907fb123..3e6a50fb4 100644 --- a/src/testdir/Make_ming.mak +++ b/src/testdir/Make_ming.mak @@ -74,6 +74,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test_options.out \ test_qf_title.out \ test_signs.out \ + test_textobjects.out \ test_utf8.out SCRIPTS32 = test50.out test70.out diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak index bab000d7c..31023ea85 100644 --- a/src/testdir/Make_os2.mak +++ b/src/testdir/Make_os2.mak @@ -54,6 +54,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test_options.out \ test_qf_title.out \ test_signs.out \ + test_textobjects.out \ test_utf8.out SCRIPTS_BENCH = bench_re_freeze.out diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms index ab1e529ea..7448d724f 100644 --- a/src/testdir/Make_vms.mms +++ b/src/testdir/Make_vms.mms @@ -4,7 +4,7 @@ # Authors: Zoltan Arpadffy, # Sandor Kopanyi, # -# Last change: 2014 Dec 13 +# Last change: 2015 Mar 13 # # 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. @@ -113,6 +113,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \ test_options.out \ test_qf_title.out \ test_signs.out \ + test_textobjects.out \ test_utf8.out # Known problems: diff --git a/src/testdir/Makefile b/src/testdir/Makefile index 626c81e8d..966183686 100644 --- a/src/testdir/Makefile +++ b/src/testdir/Makefile @@ -50,6 +50,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \ test_options.out \ test_qf_title.out \ test_signs.out \ + test_textobjects.out \ test_utf8.out SCRIPTS_GUI = test16.out diff --git a/src/testdir/test_textobjects.in b/src/testdir/test_textobjects.in new file mode 100644 index 000000000..d1cdafcd0 --- /dev/null +++ b/src/testdir/test_textobjects.in @@ -0,0 +1,40 @@ +Tests for text-objects vim: set ft=vim : + +STARTTEST +:so small.vim +:if !has('textobjects') | e! test.ok | wq! test.out | endif +:set nocompatible +:" +:function SelectionOut(data) +: new +: call setline(1, a:data) +: call setreg('"', '') +: normal! ggfrmavi)y +: $put =getreg('\"') +: call setreg('"', '') +: normal! `afbmavi)y +: $put =getreg('\"') +: call setreg('"', '') +: normal! `afgmavi)y +: $put =getreg('\"') +: %yank a +: q! +: $put =getreg('a') +:endfunction +:" +:$put ='# Test for vi) without cpo-M' +:set cpo-=M +:call SelectionOut('(red \(blue) green)') +:" +:$put ='# Test for vi) with cpo-M #1' +:set cpo+=M +:call SelectionOut('(red \(blue) green)') +:" +:$put ='# Test for vi) with cpo-M #2' +:set cpo+=M +:call SelectionOut('(red (blue\) green)') +:/^Results/,$w test.out +:qa! +ENDTEST + +Results of text-objects diff --git a/src/testdir/test_textobjects.ok b/src/testdir/test_textobjects.ok new file mode 100644 index 000000000..b670c7d81 --- /dev/null +++ b/src/testdir/test_textobjects.ok @@ -0,0 +1,16 @@ +Results of text-objects +# Test for vi) without cpo-M +(red \(blue) green) +red \(blue +red \(blue + +# Test for vi) with cpo-M #1 +(red \(blue) green) +red \(blue) green +blue +red \(blue) green +# Test for vi) with cpo-M #2 +(red (blue\) green) +red (blue\) green +blue\ +red (blue\) green diff --git a/src/version.c b/src/version.c index e523a41d1..5bb8a4c34 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 662, /**/ 661, /**/