diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-19 08:44:57 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-19 23:15:47 -0400 |
commit | 854073f1dbdf6495a589a6d6794fc77d8dbe8741 (patch) | |
tree | a4a891f2c33ad08101321ee3b8d352934dc41ec9 /src/nvim/eval.c | |
parent | 4aad4c053366592f9604ecc6d3a1348005bf2ce7 (diff) | |
download | rneovim-854073f1dbdf6495a589a6d6794fc77d8dbe8741.tar.gz rneovim-854073f1dbdf6495a589a6d6794fc77d8dbe8741.tar.bz2 rneovim-854073f1dbdf6495a589a6d6794fc77d8dbe8741.zip |
vim-patch:8.1.0901: index in getjumplist() may be wrong
Problem: Index in getjumplist() may be wrong. (Epheien)
Solution: Call cleanup_jumplist() earlier. (Yegappan Lakshmanan,
closes vim/vim#3941)
https://github.com/vim/vim/commit/57ee2b6e0b5b730d12ee9db00a8e2a577df9e374
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index a7b74b322f..6479163028 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -10060,12 +10060,12 @@ static void f_getjumplist(typval_T *argvars, typval_T *rettv, FunPtr fptr) return; } + cleanup_jumplist(wp, true); + list_T *const l = tv_list_alloc(wp->w_jumplistlen); tv_list_append_list(rettv->vval.v_list, l); tv_list_append_number(rettv->vval.v_list, wp->w_jumplistidx); - cleanup_jumplist(wp, true); - for (int i = 0; i < wp->w_jumplistlen; i++) { if (wp->w_jumplist[i].fmark.mark.lnum == 0) { continue; |