Mercurial > vim
changeset 3316:7b17a38eb223 v7.3.425
updated for version 7.3.425
Problem: Search history lines are duplicated. (Edwin Steiner)
Solution: Convert separator character from space to NUL.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 04 Feb 2012 22:44:32 +0100 |
parents | bd2542a2faa2 |
children | 8d48efa4dc15 |
files | src/ex_getln.c src/version.c |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -6027,8 +6027,10 @@ read_viminfo_history(virp) val = viminfo_readstring(virp, 1, TRUE); if (val != NULL && *val != NUL) { + int sep = (*val == ' ' ? NUL : *val); + if (!in_history(type, val + (type == HIST_SEARCH), - viminfo_add_at_front, *val)) + viminfo_add_at_front, sep)) { /* Need to re-allocate to append the separator byte. */ len = STRLEN(val); @@ -6040,7 +6042,7 @@ read_viminfo_history(virp) /* Search entry: Move the separator from the first * column to after the NUL. */ mch_memmove(p, val + 1, (size_t)len); - p[len] = (*val == ' ' ? NUL : *val); + p[len] = sep; } else {