summaryrefslogtreecommitdiffstats
path: root/src/cmdhist.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/cmdhist.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cmdhist.c b/src/cmdhist.c
index 6342f02..684c08e 100644
--- a/src/cmdhist.c
+++ b/src/cmdhist.c
@@ -297,11 +297,11 @@ static int last_maptick = -1; // last seen maptick
add_to_history(
int histype,
char_u *new_entry,
+ size_t new_entrylen,
int in_map, // consider maptick when inside a mapping
int sep) // separator character used (search hist)
{
histentry_T *hisptr;
- int len;
if (hislen == 0) // no history
return;
@@ -336,10 +336,9 @@ add_to_history(
vim_free(hisptr->hisstr);
// Store the separator after the NUL of the string.
- len = (int)STRLEN(new_entry);
- hisptr->hisstr = vim_strnsave(new_entry, len + 2);
+ hisptr->hisstr = vim_strnsave(new_entry, new_entrylen + 2);
if (hisptr->hisstr != NULL)
- hisptr->hisstr[len + 1] = sep;
+ hisptr->hisstr[new_entrylen + 1] = sep;
hisptr->hisnum = ++hisnum[histype];
hisptr->viminfo = FALSE;
@@ -566,7 +565,7 @@ f_histadd(typval_T *argvars UNUSED, typval_T *rettv)
return;
init_history();
- add_to_history(histype, str, FALSE, NUL);
+ add_to_history(histype, str, STRLEN(str), FALSE, NUL);
rettv->vval.v_number = TRUE;
}
@@ -768,7 +767,8 @@ ex_history(exarg_T *eap)
if (i == hislen)
i = 0;
if (hist[i].hisstr != NULL
- && hist[i].hisnum >= j && hist[i].hisnum <= k)
+ && hist[i].hisnum >= j && hist[i].hisnum <= k
+ && !message_filtered(hist[i].hisstr))
{
msg_putchar('\n');
sprintf((char *)IObuff, "%c%6d ", i == idx ? '>' : ' ',