overseer.nvim icon indicating copy to clipboard operation
overseer.nvim copied to clipboard

bug: The scroll doesn't work with the toggleterm strategy when opening a preview

Open k0l350v opened this issue 1 year ago • 0 comments

Neovim version (nvim -v)

NVIM v0.9.5

Operating system/version

macOS 14.2.1

Describe the bug

As I understand, if the terminal output hasn't filled the buffer yet, the scroll won't work. If you remove the delay in the output, the scroll works

output

output

What is the severity of this bug?

minor (annoyance)

Steps To Reproduce

  1. nvim -u repro.lua init.lua (init.lua attached to issue)
  2. source init.lua (execute file)

Expected Behavior

Auto-scroll activates as the buffer fills up

init.lua

local overseer = require('overseer')
local job = overseer.new_task({
	cmd = 'for i in {0..99999}; do echo $i; sleep 0.1; done',
	strategy = { 'toggleterm', open_on_start = false, }
})

job:subscribe('on_start', function()
	overseer.open({
		enter = false,
		direction = 'bottom'
	})
end)

job:start()

repro.lua

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "akinsho/toggleterm.nvim",
  { "stevearc/dressing.nvim", config = true },
  {
    "stevearc/overseer.nvim",
    config = function()
      require("overseer").setup({
        -- add your overseer config here
      })
    end,
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Additional context

It seems that this hack is affecting it https://github.com/stevearc/overseer.nvim/blob/4855aefcf335bbac71eea9c6a888958fb1ed1e1a/lua/overseer/util.lua#L141

k0l350v avatar Feb 24 '24 12:02 k0l350v