8b9a1c
To: vim_dev@googlegroups.com
8b9a1c
Subject: Patch 7.4.098
8b9a1c
Fcc: outbox
8b9a1c
From: Bram Moolenaar <Bram@moolenaar.net>
8b9a1c
Mime-Version: 1.0
8b9a1c
Content-Type: text/plain; charset=UTF-8
8b9a1c
Content-Transfer-Encoding: 8bit
8b9a1c
------------
8b9a1c
8b9a1c
Patch 7.4.098
8b9a1c
Problem:    When using ":'<,'>del" errors may be given for the visual line
8b9a1c
            numbers being out of range.
8b9a1c
Solution:   Reset Visual mode in ":del". (Lech Lorens)
8b9a1c
Files:      src/ex_docmd.c, src/testdir/test103.in, src/testdir/test103.ok,
8b9a1c
            src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak,
8b9a1c
            src/testdir/Make_ming.mak, src/testdir/Make_os2.mak,
8b9a1c
            src/testdir/Make_vms.mms, src/testdir/Makefile
8b9a1c
8b9a1c
8b9a1c
*** ../vim-7.4.097/src/ex_docmd.c	2013-11-09 05:30:18.000000000 +0100
8b9a1c
--- src/ex_docmd.c	2013-11-21 14:04:55.000000000 +0100
8b9a1c
***************
8b9a1c
*** 8570,8575 ****
8b9a1c
--- 8570,8580 ----
8b9a1c
  	beginline(BL_SOL | BL_FIX);
8b9a1c
      }
8b9a1c
  
8b9a1c
+ #if defined(FEAT_VISUAL)
8b9a1c
+     if (VIsual_active)
8b9a1c
+ 	end_visual_mode();
8b9a1c
+ #endif
8b9a1c
+ 
8b9a1c
      switch (eap->cmdidx)
8b9a1c
      {
8b9a1c
  	case CMD_delete:
8b9a1c
*** ../vim-7.4.097/src/testdir/test103.in	2013-11-21 14:21:12.000000000 +0100
8b9a1c
--- src/testdir/test103.in	2013-11-21 14:02:09.000000000 +0100
8b9a1c
***************
8b9a1c
*** 0 ****
8b9a1c
--- 1,37 ----
8b9a1c
+ Test for visual mode not being reset causing E315 error.
8b9a1c
+ STARTTEST
8b9a1c
+ :so small.vim
8b9a1c
+ :enew
8b9a1c
+ :let g:msg="Everything's fine."
8b9a1c
+ :function! TriggerTheProblem()
8b9a1c
+ :	" At this point there is no visual selection because :call reset it.
8b9a1c
+ :	" Let's restore the selection:
8b9a1c
+ :	normal gv
8b9a1c
+ :	'<,'>del _
8b9a1c
+ :	try
8b9a1c
+ :		exe "normal \<Esc>"
8b9a1c
+ :	catch /^Vim\%((\a\+)\)\=:E315/
8b9a1c
+ :		echom 'Snap! E315 error!'
8b9a1c
+ :		let g:msg='Snap! E315 error!'
8b9a1c
+ :	endtry
8b9a1c
+ :endfunction
8b9a1c
+ :enew
8b9a1c
+ :setl buftype=nofile
8b9a1c
+ :call append(line('$'), 'Delete this line.')
8b9a1c
+ :"
8b9a1c
+ :"
8b9a1c
+ :" NOTE: this has to be done by a call to a function because executing :del the
8b9a1c
+ :"       ex-way will require the colon operator which resets the visual mode thus
8b9a1c
+ :"       preventing the problem:
8b9a1c
+ :"
8b9a1c
+ GV:call TriggerTheProblem()
8b9a1c
+ :%del _
8b9a1c
+ :call append(line('$'), g:msg)
8b9a1c
+ :w! test.out
8b9a1c
+ :brewind
8b9a1c
+ ENDTEST
8b9a1c
+ 
8b9a1c
+ STARTTEST
8b9a1c
+ :qa!
8b9a1c
+ ENDTEST
8b9a1c
+ 
8b9a1c
*** ../vim-7.4.097/src/testdir/test103.ok	2013-11-21 14:21:12.000000000 +0100
8b9a1c
--- src/testdir/test103.ok	2013-11-21 14:02:28.000000000 +0100
8b9a1c
***************
8b9a1c
*** 0 ****
8b9a1c
--- 1,2 ----
8b9a1c
+ 
8b9a1c
+ Everything's fine.
8b9a1c
*** ../vim-7.4.097/src/testdir/Make_amiga.mak	2013-11-12 05:28:08.000000000 +0100
8b9a1c
--- src/testdir/Make_amiga.mak	2013-11-21 14:02:51.000000000 +0100
8b9a1c
***************
8b9a1c
*** 34,40 ****
8b9a1c
  		test81.out test82.out test83.out test84.out test88.out \
8b9a1c
  		test89.out test90.out test91.out test92.out test93.out \
8b9a1c
  		test94.out test95.out test96.out test97.out test98.out \
8b9a1c
! 		test99.out test100.out test101.out test102.out
8b9a1c
  
8b9a1c
  .SUFFIXES: .in .out
8b9a1c
  
8b9a1c
--- 34,40 ----
8b9a1c
  		test81.out test82.out test83.out test84.out test88.out \
8b9a1c
  		test89.out test90.out test91.out test92.out test93.out \
8b9a1c
  		test94.out test95.out test96.out test97.out test98.out \
8b9a1c
! 		test99.out test100.out test101.out test102.out test103.out
8b9a1c
  
8b9a1c
  .SUFFIXES: .in .out
8b9a1c
  
8b9a1c
***************
8b9a1c
*** 153,155 ****
8b9a1c
--- 153,156 ----
8b9a1c
  test100.out: test100.in
8b9a1c
  test101.out: test101.in
8b9a1c
  test102.out: test102.in
8b9a1c
+ test103.out: test103.in
8b9a1c
*** ../vim-7.4.097/src/testdir/Make_dos.mak	2013-11-12 05:28:08.000000000 +0100
8b9a1c
--- src/testdir/Make_dos.mak	2013-11-21 14:02:58.000000000 +0100
8b9a1c
***************
8b9a1c
*** 33,39 ****
8b9a1c
  		test84.out test85.out test86.out test87.out test88.out \
8b9a1c
  		test89.out test90.out test91.out test92.out test93.out \
8b9a1c
  		test94.out test95.out test96.out test98.out test99.out \
8b9a1c
! 		test100.out test101.out test102.out
8b9a1c
  
8b9a1c
  SCRIPTS32 =	test50.out test70.out
8b9a1c
  
8b9a1c
--- 33,39 ----
8b9a1c
  		test84.out test85.out test86.out test87.out test88.out \
8b9a1c
  		test89.out test90.out test91.out test92.out test93.out \
8b9a1c
  		test94.out test95.out test96.out test98.out test99.out \
8b9a1c
! 		test100.out test101.out test102.out test103.out
8b9a1c
  
8b9a1c
  SCRIPTS32 =	test50.out test70.out
8b9a1c
  
8b9a1c
*** ../vim-7.4.097/src/testdir/Make_ming.mak	2013-11-12 05:28:08.000000000 +0100
8b9a1c
--- src/testdir/Make_ming.mak	2013-11-21 14:03:01.000000000 +0100
8b9a1c
***************
8b9a1c
*** 53,59 ****
8b9a1c
  		test84.out test85.out test86.out test87.out test88.out \
8b9a1c
  		test89.out test90.out test91.out test92.out test93.out \
8b9a1c
  		test94.out test95.out test96.out test98.out test99.out \
8b9a1c
! 		test100out test101.out test102.out
8b9a1c
  
8b9a1c
  SCRIPTS32 =	test50.out test70.out
8b9a1c
  
8b9a1c
--- 53,59 ----
8b9a1c
  		test84.out test85.out test86.out test87.out test88.out \
8b9a1c
  		test89.out test90.out test91.out test92.out test93.out \
8b9a1c
  		test94.out test95.out test96.out test98.out test99.out \
8b9a1c
! 		test100out test101.out test102.out test103.out
8b9a1c
  
8b9a1c
  SCRIPTS32 =	test50.out test70.out
8b9a1c
  
8b9a1c
*** ../vim-7.4.097/src/testdir/Make_os2.mak	2013-11-12 05:28:08.000000000 +0100
8b9a1c
--- src/testdir/Make_os2.mak	2013-11-21 14:03:03.000000000 +0100
8b9a1c
***************
8b9a1c
*** 35,41 ****
8b9a1c
  		test81.out test82.out test83.out test84.out test88.out \
8b9a1c
  		test89.out test90.out test91.out test92.out test93.out \
8b9a1c
  		test94.out test95.out test96.out test98.out test99.out \
8b9a1c
! 		test100.out test101.out test102.out
8b9a1c
  
8b9a1c
  .SUFFIXES: .in .out
8b9a1c
  
8b9a1c
--- 35,41 ----
8b9a1c
  		test81.out test82.out test83.out test84.out test88.out \
8b9a1c
  		test89.out test90.out test91.out test92.out test93.out \
8b9a1c
  		test94.out test95.out test96.out test98.out test99.out \
8b9a1c
! 		test100.out test101.out test102.out test103.out
8b9a1c
  
8b9a1c
  .SUFFIXES: .in .out
8b9a1c
  
8b9a1c
*** ../vim-7.4.097/src/testdir/Make_vms.mms	2013-11-12 05:28:08.000000000 +0100
8b9a1c
--- src/testdir/Make_vms.mms	2013-11-21 14:03:13.000000000 +0100
8b9a1c
***************
8b9a1c
*** 4,10 ****
8b9a1c
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
8b9a1c
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
8b9a1c
  #
8b9a1c
! # Last change:  2013 Nov 12
8b9a1c
  #
8b9a1c
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
8b9a1c
  # Edit the lines in the Configuration section below to select.
8b9a1c
--- 4,10 ----
8b9a1c
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
8b9a1c
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
8b9a1c
  #
8b9a1c
! # Last change:  2013 Nov 21
8b9a1c
  #
8b9a1c
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
8b9a1c
  # Edit the lines in the Configuration section below to select.
8b9a1c
***************
8b9a1c
*** 79,85 ****
8b9a1c
  	 test82.out test83.out test84.out test88.out test89.out \
8b9a1c
  	 test90.out test91.out test92.out test93.out test94.out \
8b9a1c
  	 test95.out test96.out test97.out test98.out test99.out \
8b9a1c
! 	 test100.out test101.out test102.out
8b9a1c
  
8b9a1c
  # Known problems:
8b9a1c
  # Test 30: a problem around mac format - unknown reason
8b9a1c
--- 79,85 ----
8b9a1c
  	 test82.out test83.out test84.out test88.out test89.out \
8b9a1c
  	 test90.out test91.out test92.out test93.out test94.out \
8b9a1c
  	 test95.out test96.out test97.out test98.out test99.out \
8b9a1c
! 	 test100.out test101.out test102.out test103.out
8b9a1c
  
8b9a1c
  # Known problems:
8b9a1c
  # Test 30: a problem around mac format - unknown reason
8b9a1c
*** ../vim-7.4.097/src/testdir/Makefile	2013-11-12 05:28:08.000000000 +0100
8b9a1c
--- src/testdir/Makefile	2013-11-21 14:03:23.000000000 +0100
8b9a1c
***************
8b9a1c
*** 30,36 ****
8b9a1c
  		test84.out test85.out test86.out test87.out test88.out \
8b9a1c
  		test89.out test90.out test91.out test92.out test93.out \
8b9a1c
  		test94.out test95.out test96.out test97.out test98.out \
8b9a1c
! 		test99.out test100.out test101.out test102.out
8b9a1c
  
8b9a1c
  SCRIPTS_GUI = test16.out
8b9a1c
  
8b9a1c
--- 30,36 ----
8b9a1c
  		test84.out test85.out test86.out test87.out test88.out \
8b9a1c
  		test89.out test90.out test91.out test92.out test93.out \
8b9a1c
  		test94.out test95.out test96.out test97.out test98.out \
8b9a1c
! 		test99.out test100.out test101.out test102.out test103.out
8b9a1c
  
8b9a1c
  SCRIPTS_GUI = test16.out
8b9a1c
  
8b9a1c
*** ../vim-7.4.097/src/version.c	2013-11-21 13:24:36.000000000 +0100
8b9a1c
--- src/version.c	2013-11-21 14:20:34.000000000 +0100
8b9a1c
***************
8b9a1c
*** 740,741 ****
8b9a1c
--- 740,743 ----
8b9a1c
  {   /* Add new patch number below this line */
8b9a1c
+ /**/
8b9a1c
+     98,
8b9a1c
  /**/
8b9a1c
8b9a1c
-- 
8b9a1c
I recommend ordering large cargo containers of paper towels to make up
8b9a1c
whatever budget underruns you have.  Paper products are always useful and they
8b9a1c
have the advantage of being completely flushable if you need to make room in
8b9a1c
the storage area later.
8b9a1c
				(Scott Adams - The Dilbert principle)
8b9a1c
8b9a1c
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
8b9a1c
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
8b9a1c
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
8b9a1c
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///