Karsten Hopp 05f68a
To: vim_dev@googlegroups.com
Karsten Hopp 05f68a
Subject: Patch 7.4.083
Karsten Hopp 05f68a
Fcc: outbox
Karsten Hopp 05f68a
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 05f68a
Mime-Version: 1.0
Karsten Hopp 05f68a
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 05f68a
Content-Transfer-Encoding: 8bit
Karsten Hopp 05f68a
------------
Karsten Hopp 05f68a
Karsten Hopp 05f68a
Patch 7.4.083
Karsten Hopp 05f68a
Problem:    It's hard to avoid adding a used pattern to the search history.
Karsten Hopp 05f68a
Solution:   Add the ":keeppatterns" modifier. (Christian Brabandt)
Karsten Hopp 05f68a
Files:      runtime/doc/cmdline.txt, src/ex_cmds.h, src/ex_docmd.c,
Karsten Hopp 05f68a
            src/ex_getln.c, src/structs.h
Karsten Hopp 05f68a
Karsten Hopp 05f68a
Karsten Hopp 05f68a
*** ../vim-7.4.082/runtime/doc/cmdline.txt	2013-08-10 13:24:52.000000000 +0200
Karsten Hopp 05f68a
--- runtime/doc/cmdline.txt	2013-11-09 04:26:30.000000000 +0100
Karsten Hopp 05f68a
***************
Karsten Hopp 05f68a
*** 356,361 ****
Karsten Hopp 05f68a
--- 356,365 ----
Karsten Hopp 05f68a
  		List the recent five entries from all histories: >
Karsten Hopp 05f68a
  			:history all -5,
Karsten Hopp 05f68a
  
Karsten Hopp 05f68a
+ :keepp[atterns] {command}			*:keepp* *:keeppatterns*
Karsten Hopp 05f68a
+ 		Execute {command}, without adding anything to the search
Karsten Hopp 05f68a
+ 		history
Karsten Hopp 05f68a
+ 
Karsten Hopp 05f68a
  ==============================================================================
Karsten Hopp 05f68a
  2. Command-line completion				*cmdline-completion*
Karsten Hopp 05f68a
  
Karsten Hopp 05f68a
*** ../vim-7.4.082/src/ex_cmds.h	2013-06-08 15:08:20.000000000 +0200
Karsten Hopp 05f68a
--- src/ex_cmds.h	2013-11-09 04:26:30.000000000 +0100
Karsten Hopp 05f68a
***************
Karsten Hopp 05f68a
*** 477,482 ****
Karsten Hopp 05f68a
--- 477,484 ----
Karsten Hopp 05f68a
  			NEEDARG|EXTRA|NOTRLCOM),
Karsten Hopp 05f68a
  EX(CMD_keepjumps,	"keepjumps",	ex_wrongmodifier,
Karsten Hopp 05f68a
  			NEEDARG|EXTRA|NOTRLCOM),
Karsten Hopp 05f68a
+ EX(CMD_keeppatterns,	"keeppatterns",	ex_wrongmodifier,
Karsten Hopp 05f68a
+ 			NEEDARG|EXTRA|NOTRLCOM),
Karsten Hopp 05f68a
  EX(CMD_keepalt,		"keepalt",	ex_wrongmodifier,
Karsten Hopp 05f68a
  			NEEDARG|EXTRA|NOTRLCOM),
Karsten Hopp 05f68a
  EX(CMD_list,		"list",		ex_print,
Karsten Hopp 05f68a
*** ../vim-7.4.082/src/ex_docmd.c	2013-11-09 03:31:45.000000000 +0100
Karsten Hopp 05f68a
--- src/ex_docmd.c	2013-11-09 04:31:36.000000000 +0100
Karsten Hopp 05f68a
***************
Karsten Hopp 05f68a
*** 1843,1848 ****
Karsten Hopp 05f68a
--- 1843,1853 ----
Karsten Hopp 05f68a
  			    cmdmod.keepalt = TRUE;
Karsten Hopp 05f68a
  			    continue;
Karsten Hopp 05f68a
  			}
Karsten Hopp 05f68a
+ 			if (checkforcmd(&ea.cmd, "keeppatterns", 5))
Karsten Hopp 05f68a
+ 			{
Karsten Hopp 05f68a
+ 			    cmdmod.keeppatterns = TRUE;
Karsten Hopp 05f68a
+ 			    continue;
Karsten Hopp 05f68a
+ 			}
Karsten Hopp 05f68a
  			if (!checkforcmd(&ea.cmd, "keepjumps", 5))
Karsten Hopp 05f68a
  			    break;
Karsten Hopp 05f68a
  			cmdmod.keepjumps = TRUE;
Karsten Hopp 05f68a
***************
Karsten Hopp 05f68a
*** 2584,2589 ****
Karsten Hopp 05f68a
--- 2589,2595 ----
Karsten Hopp 05f68a
  	    case CMD_keepalt:
Karsten Hopp 05f68a
  	    case CMD_keepjumps:
Karsten Hopp 05f68a
  	    case CMD_keepmarks:
Karsten Hopp 05f68a
+ 	    case CMD_keeppatterns:
Karsten Hopp 05f68a
  	    case CMD_leftabove:
Karsten Hopp 05f68a
  	    case CMD_let:
Karsten Hopp 05f68a
  	    case CMD_lockmarks:
Karsten Hopp 05f68a
***************
Karsten Hopp 05f68a
*** 3089,3094 ****
Karsten Hopp 05f68a
--- 3095,3101 ----
Karsten Hopp 05f68a
      {"keepalt", 5, FALSE},
Karsten Hopp 05f68a
      {"keepjumps", 5, FALSE},
Karsten Hopp 05f68a
      {"keepmarks", 3, FALSE},
Karsten Hopp 05f68a
+     {"keeppatterns", 5, FALSE},
Karsten Hopp 05f68a
      {"leftabove", 5, FALSE},
Karsten Hopp 05f68a
      {"lockmarks", 3, FALSE},
Karsten Hopp 05f68a
      {"noautocmd", 3, FALSE},
Karsten Hopp 05f68a
***************
Karsten Hopp 05f68a
*** 3597,3602 ****
Karsten Hopp 05f68a
--- 3604,3610 ----
Karsten Hopp 05f68a
  	case CMD_keepalt:
Karsten Hopp 05f68a
  	case CMD_keepjumps:
Karsten Hopp 05f68a
  	case CMD_keepmarks:
Karsten Hopp 05f68a
+ 	case CMD_keeppatterns:
Karsten Hopp 05f68a
  	case CMD_leftabove:
Karsten Hopp 05f68a
  	case CMD_lockmarks:
Karsten Hopp 05f68a
  	case CMD_rightbelow:
Karsten Hopp 05f68a
*** ../vim-7.4.082/src/ex_getln.c	2013-11-05 07:12:59.000000000 +0100
Karsten Hopp 05f68a
--- src/ex_getln.c	2013-11-09 04:26:30.000000000 +0100
Karsten Hopp 05f68a
***************
Karsten Hopp 05f68a
*** 5498,5503 ****
Karsten Hopp 05f68a
--- 5498,5506 ----
Karsten Hopp 05f68a
      if (hislen == 0)		/* no history */
Karsten Hopp 05f68a
  	return;
Karsten Hopp 05f68a
  
Karsten Hopp 05f68a
+     if (cmdmod.keeppatterns && histype == HIST_SEARCH)
Karsten Hopp 05f68a
+ 	return;
Karsten Hopp 05f68a
+ 
Karsten Hopp 05f68a
      /*
Karsten Hopp 05f68a
       * Searches inside the same mapping overwrite each other, so that only
Karsten Hopp 05f68a
       * the last line is kept.  Be careful not to remove a line that was moved
Karsten Hopp 05f68a
*** ../vim-7.4.082/src/structs.h	2013-11-06 05:26:08.000000000 +0100
Karsten Hopp 05f68a
--- src/structs.h	2013-11-09 04:26:30.000000000 +0100
Karsten Hopp 05f68a
***************
Karsten Hopp 05f68a
*** 542,547 ****
Karsten Hopp 05f68a
--- 542,548 ----
Karsten Hopp 05f68a
      int		keepmarks;		/* TRUE when ":keepmarks" was used */
Karsten Hopp 05f68a
      int		keepjumps;		/* TRUE when ":keepjumps" was used */
Karsten Hopp 05f68a
      int		lockmarks;		/* TRUE when ":lockmarks" was used */
Karsten Hopp 05f68a
+     int		keeppatterns;		/* TRUE when ":keeppatterns" was used */
Karsten Hopp 05f68a
  # ifdef FEAT_AUTOCMD
Karsten Hopp 05f68a
      char_u	*save_ei;		/* saved value of 'eventignore' */
Karsten Hopp 05f68a
  # endif
Karsten Hopp 05f68a
*** ../vim-7.4.082/src/version.c	2013-11-09 03:31:45.000000000 +0100
Karsten Hopp 05f68a
--- src/version.c	2013-11-09 04:29:07.000000000 +0100
Karsten Hopp 05f68a
***************
Karsten Hopp 05f68a
*** 740,741 ****
Karsten Hopp 05f68a
--- 740,743 ----
Karsten Hopp 05f68a
  {   /* Add new patch number below this line */
Karsten Hopp 05f68a
+ /**/
Karsten Hopp 05f68a
+     83,
Karsten Hopp 05f68a
  /**/
Karsten Hopp 05f68a
Karsten Hopp 05f68a
-- 
Karsten Hopp 05f68a
I am always surprised in the Linux world how quickly solutions can be
Karsten Hopp 05f68a
obtained.  (Imagine sending an email to Bill Gates, asking why Windows
Karsten Hopp 05f68a
crashed, and how to fix it...  and then getting an answer that fixed the
Karsten Hopp 05f68a
problem... <0>_<0> !)		              -- Mark Langdon
Karsten Hopp 05f68a
Karsten Hopp 05f68a
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 05f68a
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 05f68a
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 05f68a
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///