mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-22 15:34:53 +01:00
fix: move to another window before setting cursor
This commit is contained in:
parent
9780059f90
commit
0a3e37c94d
1 changed files with 2 additions and 1 deletions
|
@ -60,7 +60,8 @@ M.open = function(state, path, extra)
|
||||||
local buf_name = buf_manager.users[selected.name]
|
local buf_name = buf_manager.users[selected.name]
|
||||||
local buf_id = buf_manager.map_rev[buf_name]
|
local buf_id = buf_manager.map_rev[buf_name]
|
||||||
if buf_id ~= nil then
|
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_buf(win, buf_id)
|
||||||
vim.api.nvim_win_set_cursor(win, { usr.pos[1] + 1, usr.pos[2] })
|
vim.api.nvim_win_set_cursor(win, { usr.pos[1] + 1, usr.pos[2] })
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue