if (idx < 0 && curwin->w_jumplistlen < JUMPLISTSIZE)
/* insert as the oldest entry */
idx = 0;
+ else if (idx == 0 && curwin->w_jumplistlen == JUMPLISTSIZE)
+ /* no space to insert as the oldest entry */
+ idx = -1;
}
else if (curwin->w_jumplistlen < JUMPLISTSIZE)
/* insert as oldest entry */
if (curwin->w_jumplistlen == JUMPLISTSIZE)
{
/* Drop the oldest entry. */
+ --idx;
vim_free(curwin->w_jumplist[0].fname);
for (i = 0; i < idx; ++i)
curwin->w_jumplist[i] = curwin->w_jumplist[i + 1];
clearjumps
rviminfo Xviminfo
+ let last_line = line('.')
exe "normal \<C-O>"
call assert_equal('time 30', getline('.'))
exe "normal \<C-O>"
exe "normal \<C-O>"
call assert_equal('time 05', getline('.'))
+ " Test with jumplist full.
+ clearjumps
+ call setline(1, repeat(['match here'], 101))
+ call cursor(1, 1)
+ call test_settime(10)
+ for i in range(100)
+ exe "normal /here\r"
+ endfor
+ rviminfo Xviminfo
+
+ " must be newest mark that comes from viminfo.
+ exe "normal \<C-O>"
+ call assert_equal(last_line, line('.'))
+
bwipe!
call delete('Xviminfo')
endfunc