Skip to content

Commit

Permalink
fix: scroll to end of task output when opening window
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Jan 5, 2025
1 parent 8d7ab4e commit 2a2b6fe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/overseer/window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ local function create_overseer_window(direction, existing_win)
local winid = vim.api.nvim_get_current_win()

-- create the output window if we're opening on the bottom
local task_view
if direction == "bottom" then
vim.cmd.split({ mods = { vertical = true, noautocmd = true, split = "belowright" } })
TaskView.new(0, {
task_view = TaskView.new(0, {
close_on_list_close = true,
select = function(self, tasks, task_under_cursor)
return task_under_cursor or tasks[1]
Expand Down Expand Up @@ -57,6 +58,11 @@ local function create_overseer_window(direction, existing_win)
vim.bo[bufnr].filetype = "OverseerList"

util.go_win_no_au(my_winid)

-- After all the windows are set up, scroll to the end of the task output
if task_view then
util.scroll_to_end(task_view.winid)
end
return winid
end

Expand Down

0 comments on commit 2a2b6fe

Please sign in to comment.