Problem: Command line history not read from viminfo on startup.
Solution: Get history length after initializing it.
" Test for reading and writing .viminfo
function Test_viminfo_read_and_write()
+ " First clear 'history', so that "hislen" is zero. Then set it again,
+ " simulating Vim starting up.
+ set history=0
+ wviminfo Xviminfo
+ set history=1000
+
call histdel(':')
let lines = [
\ '# comment line',
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1731,
/**/
1730,
/**/
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;
// 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);