Skip to content

Commit

Permalink
fix: scrolling shortcuts work for all output windows (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Jun 9, 2024
1 parent 09b1839 commit 6271cab
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions lua/overseer/task_list/sidebar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,21 @@ end

---@param direction integer -1 for up, 1 for down
function Sidebar:scroll_output(direction)
if not self.preview or self.preview:is_disposed() then
if not self.focused_task_id then
return
end
vim.api.nvim_win_call(self.preview.winid, function()
local key =
vim.api.nvim_replace_termcodes(direction < 0 and "<C-u>" or "<C-d>", true, true, true)
vim.cmd.normal({ args = { key }, bang = true })
end)
for _, winid in ipairs(vim.api.nvim_tabpage_list_wins(0)) do
if vim.api.nvim_win_is_valid(winid) then
local bufnr = vim.api.nvim_win_get_buf(winid)
if vim.b[bufnr].overseer_task == self.focused_task_id then
vim.api.nvim_win_call(winid, function()
local key =
vim.api.nvim_replace_termcodes(direction < 0 and "<C-u>" or "<C-d>", true, true, true)
vim.cmd.normal({ args = { key }, bang = true })
end)
end
end
end
end

function Sidebar:run_action(name)
Expand Down

0 comments on commit 6271cab

Please sign in to comment.