From ad9c11755bbae75faf098290366e45ba4d7d3ad0 Mon Sep 17 00:00:00 2001 From: Iron_E Date: Thu, 16 Jul 2020 09:29:39 -0400 Subject: [PATCH] More more logic out of the loop --- lua/highlite.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lua/highlite.lua b/lua/highlite.lua index 2bb3b3a..cc96c03 100644 --- a/lua/highlite.lua +++ b/lua/highlite.lua @@ -50,12 +50,10 @@ end or function(command, attributes) command[#command + 1] = end -- This function appends `selected_attributes` to the end of `highlight_cmd`. -local function stylize(command, attributes) +local stylize = use_hex_and_256 and function(command, attributes) + command[#command + 1] = ' cterm='..attributes..' gui='..attributes +end or function(command, attributes) command[#command + 1] = ' cterm='..attributes - - if use_hex_and_256 then -- we're using hex populate the gui* attributes. - command[#command + 1] = ' gui='..attributes - end end -- Generate a `:highlight` command from a group and some attributes.