Karsten Hopp c52ed5
To: vim_dev@googlegroups.com
Karsten Hopp c52ed5
Subject: Patch 7.4.662
Karsten Hopp c52ed5
Fcc: outbox
Karsten Hopp c52ed5
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp c52ed5
Mime-Version: 1.0
Karsten Hopp c52ed5
Content-Type: text/plain; charset=UTF-8
Karsten Hopp c52ed5
Content-Transfer-Encoding: 8bit
Karsten Hopp c52ed5
------------
Karsten Hopp c52ed5
Karsten Hopp c52ed5
Patch 7.4.662
Karsten Hopp c52ed5
Problem:    When 'M' is in the 'cpo' option then selecting a text object in
Karsten Hopp c52ed5
	    parenthesis does not work correctly.
Karsten Hopp c52ed5
Solution:   Keep 'M' in 'cpo' when finding a match. (Hirohito Higashi)
Karsten Hopp c52ed5
Files:	    src/search.c, src/testdir/Make_amiga.mak,
Karsten Hopp c52ed5
	    src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
Karsten Hopp c52ed5
	    src/testdir/Make_os2.mak, src/testdir/Make_vms.mms,
Karsten Hopp c52ed5
	    src/testdir/Makefile, src/testdir/test_textobjects.in,
Karsten Hopp c52ed5
	    src/testdir/test_textobjects.ok
Karsten Hopp c52ed5
Karsten Hopp c52ed5
Karsten Hopp c52ed5
*** ../vim-7.4.661/src/search.c	2015-03-05 19:57:45.322721298 +0100
Karsten Hopp c52ed5
--- src/search.c	2015-03-13 15:02:35.446181021 +0100
Karsten Hopp c52ed5
***************
Karsten Hopp c52ed5
*** 3583,3592 ****
Karsten Hopp c52ed5
      /*
Karsten Hopp c52ed5
       * Search backwards for unclosed '(', '{', etc..
Karsten Hopp c52ed5
       * Put this position in start_pos.
Karsten Hopp c52ed5
!      * Ignore quotes here.
Karsten Hopp c52ed5
       */
Karsten Hopp c52ed5
      save_cpo = p_cpo;
Karsten Hopp c52ed5
!     p_cpo = (char_u *)"%";
Karsten Hopp c52ed5
      while (count-- > 0)
Karsten Hopp c52ed5
      {
Karsten Hopp c52ed5
  	if ((pos = findmatch(NULL, what)) == NULL)
Karsten Hopp c52ed5
--- 3583,3593 ----
Karsten Hopp c52ed5
      /*
Karsten Hopp c52ed5
       * Search backwards for unclosed '(', '{', etc..
Karsten Hopp c52ed5
       * Put this position in start_pos.
Karsten Hopp c52ed5
!      * Ignore quotes here.  Keep the "M" flag in 'cpo', as that is what the
Karsten Hopp c52ed5
!      * user wants.
Karsten Hopp c52ed5
       */
Karsten Hopp c52ed5
      save_cpo = p_cpo;
Karsten Hopp c52ed5
!     p_cpo = (char_u *)(vim_strchr(p_cpo, CPO_MATCHBSL) != NULL ? "%M" : "%");
Karsten Hopp c52ed5
      while (count-- > 0)
Karsten Hopp c52ed5
      {
Karsten Hopp c52ed5
  	if ((pos = findmatch(NULL, what)) == NULL)
Karsten Hopp c52ed5
*** ../vim-7.4.661/src/testdir/Make_amiga.mak	2015-02-17 13:43:35.562216149 +0100
Karsten Hopp c52ed5
--- src/testdir/Make_amiga.mak	2015-03-13 15:01:04.171209323 +0100
Karsten Hopp c52ed5
***************
Karsten Hopp c52ed5
*** 53,58 ****
Karsten Hopp c52ed5
--- 53,59 ----
Karsten Hopp c52ed5
  		test_options.out \
Karsten Hopp c52ed5
  		test_qf_title.out \
Karsten Hopp c52ed5
  		test_signs.out \
Karsten Hopp c52ed5
+ 		test_textobjects.out \
Karsten Hopp c52ed5
  		test_utf8.out
Karsten Hopp c52ed5
  
Karsten Hopp c52ed5
  .SUFFIXES: .in .out
Karsten Hopp c52ed5
***************
Karsten Hopp c52ed5
*** 194,197 ****
Karsten Hopp c52ed5
--- 195,199 ----
Karsten Hopp c52ed5
  test_options.out: test_options.in
Karsten Hopp c52ed5
  test_qf_title.out: test_qf_title.in
Karsten Hopp c52ed5
  test_signs.out: test_signs.in
Karsten Hopp c52ed5
+ test_textobjects.out: test_textobjects.in
Karsten Hopp c52ed5
  test_utf8.out: test_utf8.in
Karsten Hopp c52ed5
*** ../vim-7.4.661/src/testdir/Make_dos.mak	2015-02-27 22:12:29.748834504 +0100
Karsten Hopp c52ed5
--- src/testdir/Make_dos.mak	2015-03-13 15:01:12.511115356 +0100
Karsten Hopp c52ed5
***************
Karsten Hopp c52ed5
*** 52,57 ****
Karsten Hopp c52ed5
--- 52,58 ----
Karsten Hopp c52ed5
  		test_options.out \
Karsten Hopp c52ed5
  		test_qf_title.out \
Karsten Hopp c52ed5
  		test_signs.out \
Karsten Hopp c52ed5
+ 		test_textobjects.out \
Karsten Hopp c52ed5
  		test_utf8.out
Karsten Hopp c52ed5
  
Karsten Hopp c52ed5
  SCRIPTS32 =	test50.out test70.out
Karsten Hopp c52ed5
*** ../vim-7.4.661/src/testdir/Make_ming.mak	2015-02-17 13:43:35.562216149 +0100
Karsten Hopp c52ed5
--- src/testdir/Make_ming.mak	2015-03-13 15:01:17.123063674 +0100
Karsten Hopp c52ed5
***************
Karsten Hopp c52ed5
*** 74,79 ****
Karsten Hopp c52ed5
--- 74,80 ----
Karsten Hopp c52ed5
  		test_options.out \
Karsten Hopp c52ed5
  		test_qf_title.out \
Karsten Hopp c52ed5
  		test_signs.out \
Karsten Hopp c52ed5
+ 		test_textobjects.out \
Karsten Hopp c52ed5
  		test_utf8.out
Karsten Hopp c52ed5
  
Karsten Hopp c52ed5
  SCRIPTS32 =	test50.out test70.out
Karsten Hopp c52ed5
*** ../vim-7.4.661/src/testdir/Make_os2.mak	2015-02-17 13:43:35.562216149 +0100
Karsten Hopp c52ed5
--- src/testdir/Make_os2.mak	2015-03-13 15:01:22.603001636 +0100
Karsten Hopp c52ed5
***************
Karsten Hopp c52ed5
*** 54,59 ****
Karsten Hopp c52ed5
--- 54,60 ----
Karsten Hopp c52ed5
  		test_options.out \
Karsten Hopp c52ed5
  		test_qf_title.out \
Karsten Hopp c52ed5
  		test_signs.out \
Karsten Hopp c52ed5
+ 		test_textobjects.out \
Karsten Hopp c52ed5
  		test_utf8.out
Karsten Hopp c52ed5
  
Karsten Hopp c52ed5
  SCRIPTS_BENCH = bench_re_freeze.out
Karsten Hopp c52ed5
*** ../vim-7.4.661/src/testdir/Make_vms.mms	2015-02-17 13:43:35.562216149 +0100
Karsten Hopp c52ed5
--- src/testdir/Make_vms.mms	2015-03-13 15:01:40.882795705 +0100
Karsten Hopp c52ed5
***************
Karsten Hopp c52ed5
*** 4,10 ****
Karsten Hopp c52ed5
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
Karsten Hopp c52ed5
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
Karsten Hopp c52ed5
  #
Karsten Hopp c52ed5
! # Last change:  2014 Dec 13
Karsten Hopp c52ed5
  #
Karsten Hopp c52ed5
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
Karsten Hopp c52ed5
  # Edit the lines in the Configuration section below to select.
Karsten Hopp c52ed5
--- 4,10 ----
Karsten Hopp c52ed5
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
Karsten Hopp c52ed5
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
Karsten Hopp c52ed5
  #
Karsten Hopp c52ed5
! # Last change:  2015 Mar 13
Karsten Hopp c52ed5
  #
Karsten Hopp c52ed5
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
Karsten Hopp c52ed5
  # Edit the lines in the Configuration section below to select.
Karsten Hopp c52ed5
***************
Karsten Hopp c52ed5
*** 113,118 ****
Karsten Hopp c52ed5
--- 113,119 ----
Karsten Hopp c52ed5
  	 test_options.out \
Karsten Hopp c52ed5
  	 test_qf_title.out \
Karsten Hopp c52ed5
  	 test_signs.out \
Karsten Hopp c52ed5
+ 	 test_textobjects.out \
Karsten Hopp c52ed5
  	 test_utf8.out
Karsten Hopp c52ed5
  
Karsten Hopp c52ed5
  # Known problems:
Karsten Hopp c52ed5
*** ../vim-7.4.661/src/testdir/Makefile	2015-02-17 13:43:35.562216149 +0100
Karsten Hopp c52ed5
--- src/testdir/Makefile	2015-03-13 15:01:55.786627859 +0100
Karsten Hopp c52ed5
***************
Karsten Hopp c52ed5
*** 50,55 ****
Karsten Hopp c52ed5
--- 50,56 ----
Karsten Hopp c52ed5
  		test_options.out \
Karsten Hopp c52ed5
  		test_qf_title.out \
Karsten Hopp c52ed5
  		test_signs.out \
Karsten Hopp c52ed5
+ 		test_textobjects.out \
Karsten Hopp c52ed5
  		test_utf8.out
Karsten Hopp c52ed5
  
Karsten Hopp c52ed5
  SCRIPTS_GUI = test16.out
Karsten Hopp c52ed5
*** ../vim-7.4.661/src/testdir/test_textobjects.in	2015-03-13 15:00:20.003707055 +0100
Karsten Hopp c52ed5
--- src/testdir/test_textobjects.in	2015-03-13 14:40:58.112835076 +0100
Karsten Hopp c52ed5
***************
Karsten Hopp c52ed5
*** 0 ****
Karsten Hopp c52ed5
--- 1,40 ----
Karsten Hopp c52ed5
+ Tests for text-objects     vim: set ft=vim :
Karsten Hopp c52ed5
+ 
Karsten Hopp c52ed5
+ STARTTEST
Karsten Hopp c52ed5
+ :so small.vim
Karsten Hopp c52ed5
+ :if !has('textobjects') | e! test.ok | wq! test.out | endif
Karsten Hopp c52ed5
+ :set nocompatible
Karsten Hopp c52ed5
+ :"
Karsten Hopp c52ed5
+ :function SelectionOut(data)
Karsten Hopp c52ed5
+ :  new
Karsten Hopp c52ed5
+ :  call setline(1, a:data)
Karsten Hopp c52ed5
+ :  call setreg('"', '')
Karsten Hopp c52ed5
+ :  normal! ggfrmavi)y
Karsten Hopp c52ed5
+ :  $put =getreg('\"')
Karsten Hopp c52ed5
+ :  call setreg('"', '')
Karsten Hopp c52ed5
+ :  normal! `afbmavi)y
Karsten Hopp c52ed5
+ :  $put =getreg('\"')
Karsten Hopp c52ed5
+ :  call setreg('"', '')
Karsten Hopp c52ed5
+ :  normal! `afgmavi)y
Karsten Hopp c52ed5
+ :  $put =getreg('\"')
Karsten Hopp c52ed5
+ :  %yank a
Karsten Hopp c52ed5
+ :  q!
Karsten Hopp c52ed5
+ :  $put =getreg('a')
Karsten Hopp c52ed5
+ :endfunction
Karsten Hopp c52ed5
+ :"
Karsten Hopp c52ed5
+ :$put ='# Test for vi) without cpo-M'
Karsten Hopp c52ed5
+ :set cpo-=M
Karsten Hopp c52ed5
+ :call SelectionOut('(red \(blue) green)')
Karsten Hopp c52ed5
+ :"
Karsten Hopp c52ed5
+ :$put ='# Test for vi) with cpo-M #1'
Karsten Hopp c52ed5
+ :set cpo+=M
Karsten Hopp c52ed5
+ :call SelectionOut('(red \(blue) green)')
Karsten Hopp c52ed5
+ :"
Karsten Hopp c52ed5
+ :$put ='# Test for vi) with cpo-M #2'
Karsten Hopp c52ed5
+ :set cpo+=M
Karsten Hopp c52ed5
+ :call SelectionOut('(red (blue\) green)')
Karsten Hopp c52ed5
+ :/^Results/,$w test.out
Karsten Hopp c52ed5
+ :qa!
Karsten Hopp c52ed5
+ ENDTEST
Karsten Hopp c52ed5
+ 
Karsten Hopp c52ed5
+ Results of text-objects
Karsten Hopp c52ed5
*** ../vim-7.4.661/src/testdir/test_textobjects.ok	2015-03-13 15:00:20.007707010 +0100
Karsten Hopp c52ed5
--- src/testdir/test_textobjects.ok	2015-03-13 14:40:58.112835076 +0100
Karsten Hopp c52ed5
***************
Karsten Hopp c52ed5
*** 0 ****
Karsten Hopp c52ed5
--- 1,16 ----
Karsten Hopp c52ed5
+ Results of text-objects
Karsten Hopp c52ed5
+ # Test for vi) without cpo-M
Karsten Hopp c52ed5
+ (red \(blue) green)
Karsten Hopp c52ed5
+ red \(blue
Karsten Hopp c52ed5
+ red \(blue
Karsten Hopp c52ed5
+ 
Karsten Hopp c52ed5
+ # Test for vi) with cpo-M #1
Karsten Hopp c52ed5
+ (red \(blue) green)
Karsten Hopp c52ed5
+ red \(blue) green
Karsten Hopp c52ed5
+ blue
Karsten Hopp c52ed5
+ red \(blue) green
Karsten Hopp c52ed5
+ # Test for vi) with cpo-M #2
Karsten Hopp c52ed5
+ (red (blue\) green)
Karsten Hopp c52ed5
+ red (blue\) green
Karsten Hopp c52ed5
+ blue\
Karsten Hopp c52ed5
+ red (blue\) green
Karsten Hopp c52ed5
*** ../vim-7.4.661/src/version.c	2015-03-13 13:24:16.319989139 +0100
Karsten Hopp c52ed5
--- src/version.c	2015-03-13 14:57:10.325845609 +0100
Karsten Hopp c52ed5
***************
Karsten Hopp c52ed5
*** 743,744 ****
Karsten Hopp c52ed5
--- 743,746 ----
Karsten Hopp c52ed5
  {   /* Add new patch number below this line */
Karsten Hopp c52ed5
+ /**/
Karsten Hopp c52ed5
+     662,
Karsten Hopp c52ed5
  /**/
Karsten Hopp c52ed5
Karsten Hopp c52ed5
-- 
Karsten Hopp c52ed5
GUARD #2:  It could be carried by an African swallow!
Karsten Hopp c52ed5
GUARD #1:  Oh, yeah, an African swallow maybe, but not a European swallow,
Karsten Hopp c52ed5
           that's my point.
Karsten Hopp c52ed5
GUARD #2:  Oh, yeah, I agree with that...
Karsten Hopp c52ed5
                                  The Quest for the Holy Grail (Monty Python)
Karsten Hopp c52ed5
Karsten Hopp c52ed5
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp c52ed5
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp c52ed5
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp c52ed5
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///