From a1872b9a637075cde06621a2fb2ec3b23cd85fc2 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 11 Nov 2021 22:18:23 +1100 Subject: [PATCH] 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