summaryrefslogtreecommitdiff
path: root/lua/lvim/core/lualine/components.lua
diff options
context:
space:
mode:
authorMyles Mo <[email protected]>2022-08-09 19:32:35 +0800
committerGitHub <[email protected]>2022-08-09 13:32:35 +0200
commit3bc52f9988a58e3e1a2a48ee2299383d967a1573 (patch)
tree90e8e946b7a31fa1f61fb2e875d0212b908ff66c /lua/lvim/core/lualine/components.lua
parent67366cdf89e98c285eef57a9282fc61c06aeb789 (diff)
fix(lualine): set icon color according to the status of treesitter (#2754)
Co-authored-by: emxxjnm <emxxjnm@example>
Diffstat (limited to 'lua/lvim/core/lualine/components.lua')
-rw-r--r--lua/lvim/core/lualine/components.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua
index 49a8ff81..5095cfb4 100644
--- a/lua/lvim/core/lualine/components.lua
+++ b/lua/lvim/core/lualine/components.lua
@@ -70,13 +70,13 @@ return {
},
treesitter = {
function()
- local b = vim.api.nvim_get_current_buf()
- if next(vim.treesitter.highlighter.active[b]) then
- return ""
- end
- return ""
+ return ""
+ end,
+ color = function()
+ local buf = vim.api.nvim_get_current_buf()
+ local ts = vim.treesitter.highlighter.active[buf]
+ return { fg = ts and not vim.tbl_isempty(ts) and colors.green or colors.red }
end,
- color = { fg = colors.green },
cond = conditions.hide_in_width,
},
lsp = {