summaryrefslogtreecommitdiff
path: root/src/viminfo.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-07-22 20:50:17 +0200
committerBram Moolenaar <Bram@vim.org>2019-07-22 20:50:17 +0200
commit26b654a5df9414e43734eb4c956b67c331d70a50 (patch)
tree76092e9dd7e4bd373decaa84cc132567d743eff2 /src/viminfo.c
parent1e78e69680a5f52970d9b1ef60710e556b09b8c2 (diff)
downloadvim-git-26b654a5df9414e43734eb4c956b67c331d70a50.tar.gz
patch 8.1.1731: command line history not read from viminfo on startupv8.1.1731
Problem: Command line history not read from viminfo on startup. Solution: Get history length after initializing it.
Diffstat (limited to 'src/viminfo.c')
-rw-r--r--src/viminfo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/viminfo.c b/src/viminfo.c
index 888014446..7e192cecd 100644
--- a/src/viminfo.c
+++ b/src/viminfo.c
@@ -212,9 +212,10 @@ prepare_viminfo_history(int asklen, int writing)
int num;
int type;
int len;
- int hislen = get_hislen();
+ int hislen;
init_history();
+ hislen = get_hislen();
viminfo_add_at_front = (asklen != 0 && !writing);
if (asklen > hislen)
asklen = hislen;
@@ -460,7 +461,7 @@ merge_history(int type)
// Make one long list with all entries.
max_len = hislen + viminfo_hisidx[type];
tot_hist = ALLOC_MULT(histentry_T *, max_len);
- new_hist = ALLOC_MULT(histentry_T, hislen );
+ new_hist = ALLOC_MULT(histentry_T, hislen);
if (tot_hist == NULL || new_hist == NULL)
{
vim_free(tot_hist);