From afc9c7995068e0eaf5d2972807a874537bdfbb1e Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 11 Nov 2021 13:46:50 +1100 Subject: [PATCH 1/2] resolves #27 --- lua/nvim-biscuits/init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/nvim-biscuits/init.lua b/lua/nvim-biscuits/init.lua index 060eb98..ade2d99 100644 --- a/lua/nvim-biscuits/init.lua +++ b/lua/nvim-biscuits/init.lua @@ -172,8 +172,10 @@ nvim_biscuits.BufferAttach = function(bufnr) local on_lines = function() nvim_biscuits.decorate_nodes(bufnr, lang) end - vim.cmd("highlight default link " .. make_biscuit_hl_group_name(lang) .. - " BiscuitColor") + if not lang:find("-") then + vim.cmd("highlight default link " .. make_biscuit_hl_group_name(lang) .. + " BiscuitColor") + end -- we need to fire once at the very start if config allows if toggle_keybind ~= nil and From a1872b9a637075cde06621a2fb2ec3b23cd85fc2 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 11 Nov 2021 22:18:23 +1100 Subject: [PATCH 2/2] added gsub to resolve #27 --- lua/nvim-biscuits/init.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lua/nvim-biscuits/init.lua b/lua/nvim-biscuits/init.lua index ade2d99..5cb95d4 100644 --- a/lua/nvim-biscuits/init.lua +++ b/lua/nvim-biscuits/init.lua @@ -159,7 +159,7 @@ nvim_biscuits.BufferAttach = function(bufnr) attached_buffers[bufnr] = true - local lang = ts_parsers.get_buf_lang(bufnr) + local lang = ts_parsers.get_buf_lang(bufnr):gsub("-", "") local toggle_keybind = config.get_language_config(final_config, lang, "toggle_keybind") @@ -172,10 +172,8 @@ nvim_biscuits.BufferAttach = function(bufnr) local on_lines = function() nvim_biscuits.decorate_nodes(bufnr, lang) end - if not lang:find("-") then - vim.cmd("highlight default link " .. make_biscuit_hl_group_name(lang) .. - " BiscuitColor") - end + vim.cmd("highlight default link " .. make_biscuit_hl_group_name(lang) .. + " BiscuitColor") -- we need to fire once at the very start if config allows if toggle_keybind ~= nil and