Blame SOURCES/7.4.083

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