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: Error viewing astro file #415

Closed
3 tasks done
ziriuz84 opened this issue Apr 12, 2024 · 2 comments
Closed
3 tasks done

bug v3: Error viewing astro file #415

ziriuz84 opened this issue Apr 12, 2024 · 2 comments
Labels

Comments

@ziriuz84
Copy link

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.9.5

Operating system/version

Arch Linux x86_64

Describe the bug

When I open an Astro file using LazyVim and Trouble-v3 it starts with a lot of errors like this

..hare/nvim/lazy/trouble.nvim/lua/trouble/view/section.lua:98: Error executing lua: ...e/nvim/lazy/lualine.nvim/lua/lualine/utils/nvim_opts.lua:77: E539: Illegal character <]>
stack traceback:
[C]: in function 'nvim_win_set_option'
...e/nvim/lazy/lualine.nvim/lua/lualine/utils/nvim_opts.lua:77: in function 'setter_fn'
...e/nvim/lazy/lualine.nvim/lua/lualine/utils/nvim_opts.lua:50: in function 'set_opt'
...e/nvim/lazy/lualine.nvim/lua/lualine/utils/nvim_opts.lua:74: in function 'set'
...irio/.local/share/nvim/lazy/lualine.nvim/lua/lualine.lua:432: in function 'refresh'
.../.local/share/nvim/lazy/trouble.nvim/lua/trouble/api.lua:150: in function 'on_update'
...hare/nvim/lazy/trouble.nvim/lua/trouble/view/section.lua:108: in function 'update'
...hare/nvim/lazy/trouble.nvim/lua/trouble/view/section.lua:72: in function 'finder'
...hare/nvim/lazy/trouble.nvim/lua/trouble/view/section.lua:66: in function 'fn'
...hare/nvim/lazy/trouble.nvim/lua/trouble/view/section.lua:99: in function <...hare/nvim/lazy/trouble.nvim/lua/trouble/view/section.lua:98>
[C]: in function 'nvim_win_call'
...hare/nvim/lazy/trouble.nvim/lua/trouble/view/section.lua:98: in function 'main_call'
...hare/nvim/lazy/trouble.nvim/lua/trouble/view/section.lua:64: in function 'fn'
....local/share/nvim/lazy/trouble.nvim/lua/trouble/util.lua:119: in function <....local/share/nvim/lazy/trouble.nvim/lua/trouble/util.lua:115>
[C]: in function 'xpcall'
....local/share/nvim/lazy/trouble.nvim/lua/trouble/util.lua:115: in function <....local/share/nvim/lazy/trouble.nvim/lua/trouble/util.lua:114>

If I use old version of Trouble there are no errors

Steps To Reproduce

  1. Open LazyVim
  2. Open an Astro file
  3. Wait some seconds and they appear

Expected Behavior

It will open the file without errors, now it is unusable. I tried with the repro below, but it doesn't reproduce anything, I don't know how to set it to reproduce (I'm a little newbie in this XD )

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
@ziriuz84
Copy link
Author

ziriuz84 commented Apr 12, 2024

I tried also this repro.lua, but it doesn't appear any error

-- 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
	{
		"nvim-lualine/lualine.nvim",
		dependencies = { "nvim-tree/nvim-web-devicons" },
	},
}
require("lazy").setup(plugins, {
	root = root .. "/plugins",
})

require("lualine").setup()

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

These are my extras installed

image

These are my dotfiles, if can be of any help

@folke
Copy link
Owner

folke commented May 12, 2024

I think this is probably fixed by f6a3fbf

@folke folke closed this as completed May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants