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

bug v3: Error with Lualine component

Open dpetka2001 opened this issue 1 year ago • 0 comments

Did you check docs and existing issues?

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

Neovim version (nvim -v)

NVIM v0.10.0-dev-3078+g3a8265266

Operating system/version

Linux Mint 21.3

Describe the bug

When I was trying to skim through some of lazy.nvim's code today in my locally forked repo, when i went on this line, I got the following error

   Error  07:41:31 PM notify.error Trouble ...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 <d>
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'
	...rn23/.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'
	...
	....local/share/nvim/lazy/trouble.nvim/lua/trouble/util.lua:115: in function <....local/share/nvim/lazy/trouble.nvim/lua/trouble/util.lua:114>
	[C]: at 0x5608fb05d846
	[C]: in function 'pcall'
	...ocal/share/nvim/lazy/noice.nvim/lua/noice/util/hacks.lua:177: in function <...ocal/share/nvim/lazy/noice.nvim/lua/noice/util/hacks.lua:162>
	[C]: in function 'pcall'
	...al/share/nvim/lazy/which-key.nvim/lua/which-key/view.lua:126: in function 'getchar'
	...al/share/nvim/lazy/which-key.nvim/lua/which-key/view.lua:317: in function 'on_keys'
	...al/share/nvim/lazy/which-key.nvim/lua/which-key/view.lua:255: in function 'open'
	...al/share/nvim/lazy/which-key.nvim/lua/which-key/init.lua:49: in function 'show'
	[string ":lua"]:1: in main chunk

Steps To Reproduce

  1. Clone lazy.nvim repo locally
  2. Open Neovim with Trouble v3 installed (in my case I enabled the LazyVim extra)
  3. Go to this file and line https://github.com/folke/lazy.nvim/blob/d3974346b6cef2116c8e7b08423256a834cb7cbc/lua/lazy/view/init.lua#L170
  4. Observe the error

Expected Behavior

No error

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

dpetka2001 avatar May 04 '24 16:05 dpetka2001