From b79fd4cc2431a30190ae94a68130463ee21dd9d1 Mon Sep 17 00:00:00 2001 From: shadmansaleh Date: Sun, 14 Mar 2021 20:13:46 +0600 Subject: [PATCH 1/3] Bug fix: componnet highlight not blending --- lua/lualine/highlight.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lualine/highlight.lua b/lua/lualine/highlight.lua index 5fa8f91..e7cfb6c 100644 --- a/lua/lualine/highlight.lua +++ b/lua/lualine/highlight.lua @@ -89,7 +89,7 @@ function M.create_component_highlight_group(color , highlight_tag, options) local fg = (color.fg or default_color_table.fg) -- Check if it's same as normal mode if it is no need to create aditional highlight if mode ~= 'normal' then - if bg ~= normal_hl.bg and fg ~= normal_hl.fg then + if bg ~= normal_hl.bg or fg ~= normal_hl.fg then highlight(table.concat(highlight_group_name, '_'), fg, bg, color.gui) end else From daa4cd45b3e366270727a2d6e437fcd32ec8bd59 Mon Sep 17 00:00:00 2001 From: shadmansaleh Date: Sun, 14 Mar 2021 20:14:19 +0600 Subject: [PATCH 2/3] Restructure mode conponent --- lua/lualine/components/mode.lua | 71 ++++++++++++++++----------------- 1 file changed, 34 insertions(+), 37 deletions(-) diff --git a/lua/lualine/components/mode.lua b/lua/lualine/components/mode.lua index c3218b6..57daf6a 100644 --- a/lua/lualine/components/mode.lua +++ b/lua/lualine/components/mode.lua @@ -1,44 +1,41 @@ -- Copyright (c) 2020-2021 hoob3rt -- MIT license, see LICENSE for more details. +local mode_map = { + ['n'] = 'NORMAL', + ['no'] = 'O-PENDING', + ['nov'] = 'O-PENDING', + ['noV'] = 'O-PENDING', + ['no'] = 'O-PENDING', + ['niI'] = 'NORMAL', + ['niR'] = 'NORMAL', + ['niV'] = 'NORMAL', + ['v'] = 'VISUAL', + ['V'] = 'V-LINE', + [''] = 'V-BLOCK', + ['s'] = 'SELECT', + ['S'] = 'S-LINE', + [''] = 'S-BLOCK', + ['i'] = 'INSERT', + ['ic'] = 'INSERT', + ['ix'] = 'INSERT', + ['R'] = 'REPLACE', + ['Rc'] = 'REPLACE', + ['Rv'] = 'V-REPLACE', + ['Rx'] = 'REPLACE', + ['c'] = 'COMMAND', + ['cv'] = 'EX', + ['ce'] = 'EX', + ['r'] = 'REPLACE', + ['rm'] = 'MORE', + ['r?'] = 'CONFIRM', + ['!'] = 'SHELL', + ['t'] = 'TERMINAL', +} local function mode() - local mode_map = { - ['n'] = 'NORMAL', - ['no'] = 'O-PENDING', - ['nov'] = 'O-PENDING', - ['noV'] = 'O-PENDING', - ['no'] = 'O-PENDING', - ['niI'] = 'NORMAL', - ['niR'] = 'NORMAL', - ['niV'] = 'NORMAL', - ['v'] = 'VISUAL', - ['V'] = 'V-LINE', - [''] = 'V-BLOCK', - ['s'] = 'SELECT', - ['S'] = 'S-LINE', - [''] = 'S-BLOCK', - ['i'] = 'INSERT', - ['ic'] = 'INSERT', - ['ix'] = 'INSERT', - ['R'] = 'REPLACE', - ['Rc'] = 'REPLACE', - ['Rv'] = 'V-REPLACE', - ['Rx'] = 'REPLACE', - ['c'] = 'COMMAND', - ['cv'] = 'EX', - ['ce'] = 'EX', - ['r'] = 'REPLACE', - ['rm'] = 'MORE', - ['r?'] = 'CONFIRM', - ['!'] = 'SHELL', - ['t'] = 'TERMINAL', - } - local function get_mode() - local mode_code = vim.api.nvim_get_mode().mode - if mode_map[mode_code] == nil then return mode_code end - return mode_map[mode_code] - end - return get_mode() + local mode_code = vim.api.nvim_get_mode().mode + if mode_map[mode_code] == nil then return mode_code end + return mode_map[mode_code] end return mode From be0259a3b865ca5d3d4881911ce086b35c390e76 Mon Sep 17 00:00:00 2001 From: shadmansaleh Date: Sun, 14 Mar 2021 20:14:42 +0600 Subject: [PATCH 3/3] Add tags to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 6fd0a37..b66220c 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,5 @@ luac.out *.x86_64 *.hex +# ctags +tags