summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-11-09 05:30:26 +0100
committerBram Moolenaar <Bram@vim.org>2013-11-09 05:30:26 +0100
commita939e434407b749adf4d50ea9f3f13b6a9abaf86 (patch)
tree7694960d7e76e61912c84b780a6daae8afbc42f7 /src
parent8e69b4a319d7933d491ac49a2812c964e8dc85b3 (diff)
downloadvim-git-a939e434407b749adf4d50ea9f3f13b6a9abaf86.tar.gz
updated for version 7.4.083v7.4.083
Problem: It's hard to avoid adding a used pattern to the search history. Solution: Add the ":keeppatterns" modifier. (Christian Brabandt)
Diffstat (limited to 'src')
-rw-r--r--src/ex_cmds.h2
-rw-r--r--src/ex_docmd.c8
-rw-r--r--src/ex_getln.c3
-rw-r--r--src/structs.h1
-rw-r--r--src/version.c2
5 files changed, 16 insertions, 0 deletions
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index 86bcead76..6cc4c7e13 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -477,6 +477,8 @@ EX(CMD_keepmarks, "keepmarks", ex_wrongmodifier,
NEEDARG|EXTRA|NOTRLCOM),
EX(CMD_keepjumps, "keepjumps", ex_wrongmodifier,
NEEDARG|EXTRA|NOTRLCOM),
+EX(CMD_keeppatterns, "keeppatterns", ex_wrongmodifier,
+ NEEDARG|EXTRA|NOTRLCOM),
EX(CMD_keepalt, "keepalt", ex_wrongmodifier,
NEEDARG|EXTRA|NOTRLCOM),
EX(CMD_list, "list", ex_print,
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 8d06a95c9..1c700d473 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1843,6 +1843,11 @@ do_one_cmd(cmdlinep, sourcing,
cmdmod.keepalt = TRUE;
continue;
}
+ if (checkforcmd(&ea.cmd, "keeppatterns", 5))
+ {
+ cmdmod.keeppatterns = TRUE;
+ continue;
+ }
if (!checkforcmd(&ea.cmd, "keepjumps", 5))
break;
cmdmod.keepjumps = TRUE;
@@ -2584,6 +2589,7 @@ do_one_cmd(cmdlinep, sourcing,
case CMD_keepalt:
case CMD_keepjumps:
case CMD_keepmarks:
+ case CMD_keeppatterns:
case CMD_leftabove:
case CMD_let:
case CMD_lockmarks:
@@ -3089,6 +3095,7 @@ static struct cmdmod
{"keepalt", 5, FALSE},
{"keepjumps", 5, FALSE},
{"keepmarks", 3, FALSE},
+ {"keeppatterns", 5, FALSE},
{"leftabove", 5, FALSE},
{"lockmarks", 3, FALSE},
{"noautocmd", 3, FALSE},
@@ -3597,6 +3604,7 @@ set_one_cmd_context(xp, buff)
case CMD_keepalt:
case CMD_keepjumps:
case CMD_keepmarks:
+ case CMD_keeppatterns:
case CMD_leftabove:
case CMD_lockmarks:
case CMD_rightbelow:
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 7ec47c702..906eb8bb0 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -5498,6 +5498,9 @@ add_to_history(histype, new_entry, in_map, sep)
if (hislen == 0) /* no history */
return;
+ if (cmdmod.keeppatterns && histype == HIST_SEARCH)
+ return;
+
/*
* Searches inside the same mapping overwrite each other, so that only
* the last line is kept. Be careful not to remove a line that was moved
diff --git a/src/structs.h b/src/structs.h
index f3f3aaa89..3c3fd7ba2 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -542,6 +542,7 @@ typedef struct
int keepmarks; /* TRUE when ":keepmarks" was used */
int keepjumps; /* TRUE when ":keepjumps" was used */
int lockmarks; /* TRUE when ":lockmarks" was used */
+ int keeppatterns; /* TRUE when ":keeppatterns" was used */
# ifdef FEAT_AUTOCMD
char_u *save_ei; /* saved value of 'eventignore' */
# endif
diff --git a/src/version.c b/src/version.c
index e4b039e31..ce5d25053 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 83,
+/**/
82,
/**/
81,