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

bug v3: popup error msg after create new buffer and set filetype to lua #434

Closed
3 tasks done
Urie96 opened this issue May 17, 2024 · 1 comment · Fixed by #437
Closed
3 tasks done

bug v3: popup error msg after create new buffer and set filetype to lua #434

Urie96 opened this issue May 17, 2024 · 1 comment · Fixed by #437
Labels

Comments

@Urie96
Copy link

Urie96 commented May 17, 2024

Did you check docs and existing issues?

  • I have read all the trouble.nvim docs
  • I have searched the existing issues of trouble.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0-dev-3004+gb13e63db1-Homebrew

Operating system/version

macos 13.0

Describe the bug

Error executing vim.schedule lua callback: ...vim/HEAD-b13e63d/share/nvim/runtime/lua/vim/lsp/util.lua:294: bad argument #1 to 'gmatch' (string expected, got nil)
stack traceback:
[C]: in function 'gmatch'
...vim/HEAD-b13e63d/share/nvim/runtime/lua/vim/lsp/util.lua:294: in function 'get_lines'
...vim/HEAD-b13e63d/share/nvim/runtime/lua/vim/lsp/util.lua:322: in function 'get_line'
...vim/HEAD-b13e63d/share/nvim/runtime/lua/vim/lsp/util.lua:335: in function 'get_col'
...share/nvim/lazy/trouble.nvim/lua/trouble/sources/lsp.lua:212: in function 'location'
...share/nvim/lazy/trouble.nvim/lua/trouble/sources/lsp.lua:194: in function 'location_to_item'
...share/nvim/lazy/trouble.nvim/lua/trouble/sources/lsp.lua:149: in function 'add'
...share/nvim/lazy/trouble.nvim/lua/trouble/sources/lsp.lua:165: in function 'cb'
...share/nvim/lazy/trouble.nvim/lua/trouble/sources/lsp.lua:100: in function 'handler'
...m/HEAD-b13e63d/share/nvim/runtime/lua/vim/lsp/client.lua:693: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>

Steps To Reproduce

  1. enable trouble v3 through Lazyvim { import = "lazyvim.plugins.extras.editor.trouble-v3" }
  2. cd to an empty dir
  3. nvim a.lua
  4. run :enew
  5. type a=1
  6. run :setf lua
  7. error msg show, and repeatly popup error after moving cursor

Expected Behavior

no error popup

Repro

-- 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", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/trouble.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
@folke
Copy link
Owner

folke commented May 17, 2024

Should be fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants