File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1452,8 +1452,10 @@ function Previewer.marks:parse_entry(entry_str)
14521452
14531453 -- nvim_buf_get_mark cannot get `'` mark correctly without curwin
14541454 -- https://github.com/neovim/neovim/issues/29807
1455- local pos = api .nvim_win_call (self .win .src_winid , function ()
1456- return vim .api .nvim_buf_get_mark (self .win .src_bufnr , mark )
1455+ local win = vim .api .nvim_win_is_valid (self .win .src_winid ) and self .win .src_winid or 0
1456+ local buf = vim .api .nvim_buf_is_valid (self .win .src_bufnr ) and self .win .src_bufnr or 0
1457+ local pos = api .nvim_win_call (win , function ()
1458+ return vim .api .nvim_buf_get_mark (buf , mark )
14571459 end )
14581460 if pos and pos [1 ] > 0 then
14591461 assert (pos [1 ] == tonumber (lnum ))
Original file line number Diff line number Diff line change @@ -254,6 +254,8 @@ M.marks = function(opts)
254254 local contents = function (cb )
255255 local win = utils .CTX ().winid
256256 local buf = utils .CTX ().bufnr
257+ win = vim .api .nvim_win_is_valid (win ) and win or 0
258+ buf = vim .api .nvim_win_is_valid (buf ) and buf or 0
257259 local marks = vim .api .nvim_win_call (win , function ()
258260 return vim .api .nvim_buf_call (buf , function () return vim .fn .execute (" marks" ) end )
259261 end )
You can’t perform that action at this time.
0 commit comments