Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message when opening the command line window with q: #437

Open
tyrdal opened this issue May 9, 2024 · 2 comments
Open

Error message when opening the command line window with q: #437

tyrdal opened this issue May 9, 2024 · 2 comments
Labels
bug Something isn't working unable to reproduce

Comments

@tyrdal
Copy link

tyrdal commented May 9, 2024

Description

When I open the command line window with q: I get the following error message:

Error executing vim.schedule lua callback: ...vim-treesitter-context/lua/treesitter-context/render.lua:310: E11: Invalid in command-line window; <CR> executes, CTRL-C quits
stack traceback:
	[C]: in function 'nvim_win_close'
	...vim-treesitter-context/lua/treesitter-context/render.lua:310: in function <...vim-treesitter-context/lua/treesitter-context/render.lua:308>
Error executing vim.schedule lua callback: ...vim-treesitter-context/lua/treesitter-context/render.lua:310: E11: Invalid in command-line window; <CR> executes, CTRL-C quits

Neovim version

0.9.5

Expected behavior

If the context is not applicable then just don't run it there and avoid the error.

Actual behavior

See description.

Minimal config

local plugins = {
  ts         = 'https://github.com/nvim-treesitter/nvim-treesitter',
  ts_context = 'https://github.com/nvim-treesitter/nvim-treesitter-context',
  -- ADD ADDITIONAL PLUGINS THAT ARE _NECESSARY_ TO REPRODUCE THE ISSUE
}

for name, url in pairs(plugins) do
  local install_path = '/tmp/nvim/site/'..name
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
  vim.o.runtimepath = install_path..','..vim.o.runtimepath
end

-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE

Steps to reproduce

  1. nvim --clean -u minimal.lua
  2. TSInstall
  3. Make sure the setup functions have run for for treesitter and your plugin
  4. Open a file that you installed a parser for in step 2
  5. run q: in normal mode or hit : and follow it with crl+f
@tyrdal tyrdal added the bug Something isn't working label May 9, 2024
@lewis6991
Copy link
Member

Unable to reproduce in nvim 0.10.0. Please check.

@rafamadriz
Copy link

Unable to reproduce in nvim 0.10.0. Please check.

Having the same issue, I was able to reproduce with the minimal config provided on 0.9.5. You just have to make sure to enable treesitter-context. Here's an example:

https://asciinema.org/a/spFeVFBKRarvuKgyG5HtTIIxq

I also tried on 0.10 and there's no error, so it seems to be a 0.9.5 thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unable to reproduce
Projects
None yet
Development

No branches or pull requests

3 participants