fix: move to another window before setting cursor

This commit is contained in:
əlemi 2024-09-16 20:26:20 +02:00
parent 9780059f90
commit 0a3e37c94d
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -60,7 +60,8 @@ M.open = function(state, path, extra)
local buf_name = buf_manager.users[selected.name]
local buf_id = buf_manager.map_rev[buf_name]
if buf_id ~= nil then
local win = vim.api.nvim_get_current_win()
local win = utils.get_appropriate_window(state)
vim.api.nvim_set_current_win(win)
vim.api.nvim_win_set_buf(win, buf_id)
vim.api.nvim_win_set_cursor(win, { usr.pos[1] + 1, usr.pos[2] })
else