comparison src/viminfo.c @ 17466:15de78cb9f39 v8.1.1731

patch 8.1.1731: command line history not read from viminfo on startup commit https://github.com/vim/vim/commit/26b654a5df9414e43734eb4c956b67c331d70a50 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jul 22 20:50:17 2019 +0200 patch 8.1.1731: command line history not read from viminfo on startup Problem: Command line history not read from viminfo on startup. Solution: Get history length after initializing it.
author Bram Moolenaar <Bram@vim.org>
date Mon, 22 Jul 2019 21:00:06 +0200
parents 3e708b5c0509
children d4b2a212fa2f
comparison
equal deleted inserted replaced
17465:2841dc265ad7 17466:15de78cb9f39
210 { 210 {
211 int i; 211 int i;
212 int num; 212 int num;
213 int type; 213 int type;
214 int len; 214 int len;
215 int hislen = get_hislen(); 215 int hislen;
216 216
217 init_history(); 217 init_history();
218 hislen = get_hislen();
218 viminfo_add_at_front = (asklen != 0 && !writing); 219 viminfo_add_at_front = (asklen != 0 && !writing);
219 if (asklen > hislen) 220 if (asklen > hislen)
220 asklen = hislen; 221 asklen = hislen;
221 222
222 for (type = 0; type < HIST_COUNT; ++type) 223 for (type = 0; type < HIST_COUNT; ++type)
458 int *hisnum = get_hisnum(type); 459 int *hisnum = get_hisnum(type);
459 460
460 // Make one long list with all entries. 461 // Make one long list with all entries.
461 max_len = hislen + viminfo_hisidx[type]; 462 max_len = hislen + viminfo_hisidx[type];
462 tot_hist = ALLOC_MULT(histentry_T *, max_len); 463 tot_hist = ALLOC_MULT(histentry_T *, max_len);
463 new_hist = ALLOC_MULT(histentry_T, hislen ); 464 new_hist = ALLOC_MULT(histentry_T, hislen);
464 if (tot_hist == NULL || new_hist == NULL) 465 if (tot_hist == NULL || new_hist == NULL)
465 { 466 {
466 vim_free(tot_hist); 467 vim_free(tot_hist);
467 vim_free(new_hist); 468 vim_free(new_hist);
468 return; 469 return;