mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(util.job): use nvim_win_set_cursor instead of gg
This commit is contained in:
parent
fb011c257f
commit
5faed2f7ab
1 changed files with 3 additions and 6 deletions
|
|
@ -127,7 +127,7 @@ function Job:on_exit(code)
|
|||
self:hide_process_exited()
|
||||
end
|
||||
|
||||
self:norm("gg")
|
||||
self:set_cursor()
|
||||
|
||||
if not self.killed and code ~= 0 then
|
||||
self:error(
|
||||
|
|
@ -137,15 +137,12 @@ function Job:on_exit(code)
|
|||
end
|
||||
end
|
||||
|
||||
---@param cmd string
|
||||
function Job:norm(cmd)
|
||||
function Job:set_cursor()
|
||||
if not self:buf_valid() then
|
||||
return
|
||||
end
|
||||
for _, win in ipairs(vim.fn.win_findbuf(self.buf)) do
|
||||
vim.api.nvim_win_call(win, function()
|
||||
vim.cmd("normal! " .. cmd)
|
||||
end)
|
||||
vim.api.nvim_win_set_cursor(win, { 1, 0 })
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue