Skip to content

bug: OverseerRun in a cargo project causes error: E5560 Vimscript function "inputlist" must not be called in a fast event context #456

@fleesk

Description

@fleesk

Neovim version (nvim -v)

0.11.5

Operating system/version

Arch Linux

Describe the bug

in 2.0, :OverseerRun in a basic cargo project immediately leads to the following error:

Error executing callback:                                                                                                                                                                                  
/usr/share/nvim/runtime/lua/vim/ui.lua:51: E5560: Vimscript function "inputlist" must not be called in a fast event context                                                                                         
stack traceback:                                                                                                                                                                                                    
        [C]: in function 'inputlist'                                                                                                                                                                                
        /usr/share/nvim/runtime/lua/vim/ui.lua:51: in function 'select'                                                                                                                                             
        ...e/.repro/plugins/overseer.nvim/lua/overseer/commands.lua:181: in function 'cb'                                                                                                                           
        ...e/.repro/plugins/overseer.nvim/lua/overseer/template.lua:500: in function 'final_callback'                                                                                                               
        ...e/.repro/plugins/overseer.nvim/lua/overseer/template.lua:562: in function 'handle_tmpls'                                                                                                                 
        ...e/.repro/plugins/overseer.nvim/lua/overseer/template.lua:597: in function 'cb'                                                                                                                           
        ...ro/plugins/overseer.nvim/lua/overseer/template/cargo.lua:99: in function 'cb'                                                                                                                            
        ...ro/plugins/overseer.nvim/lua/overseer/template/cargo.lua:22: in function 'on_exit'                                                                                                                       
        /usr/share/nvim/runtime/lua/vim/_system.lua:318: in function </usr/share/nvim/runtime/lua/vim/_system.lua:288>

snacks picker and fzf-lua also break with similar errors if set to override vim.ui.select:

Error executing callback:                                                                                                                                                                                           
...mini/.repro/plugins/snacks.nvim/lua/snacks/util/init.lua:62: E5560: nvim_set_hl must not be called in a fast event context                                                                                       
stack traceback:                                                                                                                                                                                                    
        [C]: in function 'nvim_set_hl'                                                                                                                                                                              
        ...mini/.repro/plugins/snacks.nvim/lua/snacks/util/init.lua:62: in function 'set_hl'                                                                                                                        
        ...ro/plugins/snacks.nvim/lua/snacks/picker/config/init.lua:99: in function 'get'                                                                                                                           
        .../.repro/plugins/snacks.nvim/lua/snacks/picker/select.lua:83: in function 'select'                                                                                                                        
        ...i/.repro/plugins/overseer.nvim/lua/overseer/commands.lua:181: in function 'cb'                                                                                                                           
        ...i/.repro/plugins/overseer.nvim/lua/overseer/template.lua:500: in function 'final_callback'                                                                                                               
        ...i/.repro/plugins/overseer.nvim/lua/overseer/template.lua:562: in function 'handle_tmpls'                                                                                                                 
        ...i/.repro/plugins/overseer.nvim/lua/overseer/template.lua:597: in function 'cb'                                                                                                                           
        ...ro/plugins/overseer.nvim/lua/overseer/template/cargo.lua:99: in function 'cb'                                                                                                                            
        ...ro/plugins/overseer.nvim/lua/overseer/template/cargo.lua:22: in function 'on_exit'                                                                                                                       
        /usr/share/nvim/runtime/lua/vim/_system.lua:318: in function </usr/share/nvim/runtime/lua/vim/_system.lua:288>

With dressing.nvim installed (which is a dependency in the provided minimal init.lua file, but is an archived repo), and NO picker plugin (snacks/fzf), the expected task selection window is opened with no errors and the tasks can be executed.

It seems to work fine with other projects, at least Makefiles. I haven't tested other builtins yet.

What is the severity of this bug?

breaking (some functionality is broken)

Steps To Reproduce

  1. run cargo init in a new directory
  2. nvim -u init.lua
  3. run :OverseerRun

Expected Behavior

Open the usual task selection window

Minimal example file

Run cargo init

Minimal init.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",
  -- { "stevearc/dressing.nvim", config = true },
  {
    "stevearc/overseer.nvim",
    config = function()
      require("overseer").setup({
        -- add your overseer config here
      })
    end,
  },
  -- add any other plugins here
  -- {
  --   "folke/snacks.nvim",
  --   priority = 1000,
  --   version = "*",
  --   lazy = false,
  --   ---@type snacks.Config | {}
  --   opts = {
  --     picker = {
  --       enabled = true,
  --       ui_select = true,
  --     },
  --   },
  -- }
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

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

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions