Dkendal / nvim-treeclimber

Neovim structured editing plugin
Apache License 2.0
163 stars 3 forks source link

Suggestion: remove lush dependancy #3

Closed CharlesChiuGit closed 1 year ago

CharlesChiuGit commented 1 year ago

It very convenient to use

local normal_background = vim.api.nvim_get_hl_by_name("Normal", true).background
local blend_color = normal_background ~= nil and string.format("#%06x", normal_background) or "#000000"

to get the hex of certain highlight group, no need extra plugin to do that.

I understood you had already said it will be remove eventually, but I think a little help would do not harm.

Dkendal commented 1 year ago

Yea, I agree! I'd like to remove it and just vendor in some color functions instead.

Shfty commented 1 year ago

The default configuration appears broken under my NVIM 0.9.0 setup; with lush installed, invoking the setup() function or using the manual configuration snippet from the README results in:

E5108: Error executing lua ...plugins/start/nvim-treeclimber/lua/nvim-treeclimber/hi.lua:16: bad argument #2 to 'hex' (number expected, got nil)

Removing the highlight setup entirely results in working commands, but is obviously not ideal.

In addition, the mentioned nvim_get_hl_by_name function appears to have been deprecated and replaced with a new nvim_get_hl replacement with a different arrangement of input parameters.

I tried to get some useful output from it, but requesting the Normal group in the global namespace returns an empty table. I wonder if this could be the root of the problem - i.e. some local configuration of mine relating to transparent termainals and guifg / guibg stuff breaking some assumption being made by nvim-treeclimber / lush?

Dkendal commented 1 year ago

This is fixed on main now, Lush is no longer a dependency.