diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-03-13 15:03:00 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-03-13 15:03:00 +0100 |
commit | 438b64ab71cd724129c4eec840be16c52602ebc8 (patch) | |
tree | f4e0bbe63d50be0268e3f7a627574256df7260b5 | |
parent | 6c5bdb751c0c77be7d03a6000134d1df367763d2 (diff) |
updated for version 7.4.662v7.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)
-rw-r--r-- | src/search.c | 5 | ||||
-rw-r--r-- | src/testdir/Make_amiga.mak | 2 | ||||
-rw-r--r-- | src/testdir/Make_dos.mak | 1 | ||||
-rw-r--r-- | src/testdir/Make_ming.mak | 1 | ||||
-rw-r--r-- | src/testdir/Make_os2.mak | 1 | ||||
-rw-r--r-- | src/testdir/Make_vms.mms | 3 | ||||
-rw-r--r-- | src/testdir/Makefile | 1 | ||||
-rw-r--r-- | src/testdir/test_textobjects.in | 40 | ||||
-rw-r--r-- | src/testdir/test_textobjects.ok | 16 | ||||
-rw-r--r-- | src/version.c | 2 |
10 files changed, 69 insertions, 3 deletions
diff --git a/src/search.c b/src/search.c index 8beacbbc3f..7022870c4c 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 2567d52e75..cc4af8934b 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 4b17f96f4b..fcd81b54df 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 a907fb123a..3e6a50fb41 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 bab000d7c0..31023ea85e 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 ab1e529ea0..7448d724fc 100644 --- a/src/testdir/Make_vms.mms +++ b/src/testdir/Make_vms.mms @@ -4,7 +4,7 @@ # Authors: Zoltan Arpadffy, <arpadffy@polarhome.com> # Sandor Kopanyi, <sandor.kopanyi@mailbox.hu> # -# 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 626c81e8d5..966183686e 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 0000000000..d1cdafcd04 --- /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 0000000000..b670c7d816 --- /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 e523a41d17..5bb8a4c34b 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 662, +/**/ 661, /**/ 660, |