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