Skip to content

Commit

Permalink
Merge pull request #6 from desdic/20240321cursor
Browse files Browse the repository at this point in the history
fix: Don't fail if line no longer exist
  • Loading branch information
desdic authored Mar 21, 2024
2 parents 75d7005 + 2bdb8e6 commit fa3d9bb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lua/marlin/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,12 @@ marlin.open = function(index, opts)
marlin.opts.open_callback(bufnr, opts)

if set_position then
vim.api.nvim_win_set_cursor(0, {
cur_item.row or 1,
cur_item.col or 0,
})
pcall(function()
vim.api.nvim_win_set_cursor(0, {
cur_item.row or 1,
cur_item.col or 0,
})
end)
end
end

Expand Down

0 comments on commit fa3d9bb

Please sign in to comment.