From e40182919396dc100630975d68ed879473ec7da4 Mon Sep 17 00:00:00 2001 From: Abouzar Parvan Date: Sun, 5 Sep 2021 18:33:58 +0430 Subject: [BUGFIX] don't show table address in lualine (#1477) --- lua/core/lualine/components.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lua/core/lualine') diff --git a/lua/core/lualine/components.lua b/lua/core/lualine/components.lua index 894d9e9b..3d3ac9af 100644 --- a/lua/core/lualine/components.lua +++ b/lua/core/lualine/components.lua @@ -81,9 +81,12 @@ return { }, lsp = { function(msg) - msg = msg or "LSP Inactive" + msg = msg or "LS Inactive" local buf_clients = vim.lsp.buf_get_clients() if next(buf_clients) == nil then + if #msg == 0 then + return "LS Inactive" + end return msg end local buf_ft = vim.bo.filetype -- cgit v1.2.3 From 151684bba11b702907e58d2acdd41ebc69c27809 Mon Sep 17 00:00:00 2001 From: Abouzar Parvan Date: Mon, 6 Sep 2021 22:53:41 +0430 Subject: there was a weird situation that caused lualine msg to turn boolean instead of table (#1492) --- lua/core/lualine/components.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lua/core/lualine') diff --git a/lua/core/lualine/components.lua b/lua/core/lualine/components.lua index 3d3ac9af..5d240f46 100644 --- a/lua/core/lualine/components.lua +++ b/lua/core/lualine/components.lua @@ -84,7 +84,8 @@ return { msg = msg or "LS Inactive" local buf_clients = vim.lsp.buf_get_clients() if next(buf_clients) == nil then - if #msg == 0 then + -- TODO: clean up this if statement + if type(msg) == "boolean" or #msg == 0 then return "LS Inactive" end return msg -- cgit v1.2.3 From 08345170081b5882535eaf32406a9c0e1b0a6f56 Mon Sep 17 00:00:00 2001 From: luetage Date: Thu, 9 Sep 2021 02:43:30 +0200 Subject: Show treesitter icon only with supported filetype (#1512) --- lua/core/lualine/components.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lua/core/lualine') diff --git a/lua/core/lualine/components.lua b/lua/core/lualine/components.lua index 5d240f46..c6800f49 100644 --- a/lua/core/lualine/components.lua +++ b/lua/core/lualine/components.lua @@ -71,7 +71,8 @@ return { }, treesitter = { function() - if next(vim.treesitter.highlighter.active) then + local b = vim.api.nvim_get_current_buf() + if next(vim.treesitter.highlighter.active[b]) then return "  " end return "" -- cgit v1.2.3 From df0da6fc75c60c8bd2791b7cdb9d05d12a25bb50 Mon Sep 17 00:00:00 2001 From: Abouzar Parvan Date: Wed, 15 Sep 2021 23:41:21 +0430 Subject: [bugfix] Update lualine according to the breaking changes (#1558) --- lua/core/lualine/components.lua | 44 ++++++++++++++++++++--------------------- lua/core/lualine/styles.lua | 12 +++++------ 2 files changed, 28 insertions(+), 28 deletions(-) (limited to 'lua/core/lualine') diff --git a/lua/core/lualine/components.lua b/lua/core/lualine/components.lua index c6800f49..21e25585 100644 --- a/lua/core/lualine/components.lua +++ b/lua/core/lualine/components.lua @@ -17,31 +17,32 @@ return { function() return " " end, - left_padding = 0, - right_padding = 0, + padding = { left = 0, right = 0 }, color = {}, - condition = nil, + cond = nil, }, branch = { "b:gitsigns_head", icon = " ", color = { gui = "bold" }, - condition = conditions.hide_in_width, + cond = conditions.hide_in_width, }, filename = { "filename", color = {}, - condition = nil, + cond = nil, }, diff = { "diff", source = diff_source, symbols = { added = "  ", modified = "柳", removed = " " }, - color_added = { fg = colors.green }, - color_modified = { fg = colors.yellow }, - color_removed = { fg = colors.red }, + diff_color = { + added = { fg = colors.green }, + modified = { fg = colors.yellow }, + removed = { fg = colors.red }, + }, color = {}, - condition = nil, + cond = nil, }, python_env = { function() @@ -60,14 +61,14 @@ return { return "" end, color = { fg = colors.green }, - condition = conditions.hide_in_width, + cond = conditions.hide_in_width, }, diagnostics = { "diagnostics", sources = { "nvim_lsp" }, symbols = { error = " ", warn = " ", info = " ", hint = " " }, color = {}, - condition = conditions.hide_in_width, + cond = conditions.hide_in_width, }, treesitter = { function() @@ -78,7 +79,7 @@ return { return "" end, color = { fg = colors.green }, - condition = conditions.hide_in_width, + cond = conditions.hide_in_width, }, lsp = { function(msg) @@ -118,10 +119,10 @@ return { end, icon = " ", color = { gui = "bold" }, - condition = conditions.hide_in_width, + cond = conditions.hide_in_width, }, - location = { "location", condition = conditions.hide_in_width, color = {} }, - progress = { "progress", condition = conditions.hide_in_width, color = {} }, + location = { "location", cond = conditions.hide_in_width, color = {} }, + progress = { "progress", cond = conditions.hide_in_width, color = {} }, spaces = { function() local label = "Spaces: " @@ -130,16 +131,16 @@ return { end return label .. vim.api.nvim_buf_get_option(0, "shiftwidth") .. " " end, - condition = conditions.hide_in_width, + cond = conditions.hide_in_width, color = {}, }, encoding = { "o:encoding", - upper = true, + fmt = string.upper, color = {}, - condition = conditions.hide_in_width, + cond = conditions.hide_in_width, }, - filetype = { "filetype", condition = conditions.hide_in_width, color = {} }, + filetype = { "filetype", cond = conditions.hide_in_width, color = {} }, scrollbar = { function() local current_line = vim.fn.line "." @@ -149,9 +150,8 @@ return { local index = math.ceil(line_ratio * #chars) return chars[index] end, - left_padding = 0, - right_padding = 0, + padding = { left = 0, right = 0 }, color = { fg = colors.yellow, bg = colors.bg }, - condition = nil, + cond = nil, }, } diff --git a/lua/core/lualine/styles.lua b/lua/core/lualine/styles.lua index 3595e5e3..19097424 100644 --- a/lua/core/lualine/styles.lua +++ b/lua/core/lualine/styles.lua @@ -11,8 +11,8 @@ styles.none = { style = "none", options = { icons_enabled = true, - component_separators = "", - section_separators = "", + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, disabled_filetypes = {}, }, sections = { @@ -39,8 +39,8 @@ styles.default = { style = "default", options = { icons_enabled = true, - component_separators = { "", "" }, - section_separators = { "", "" }, + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, disabled_filetypes = {}, }, sections = { @@ -67,8 +67,8 @@ styles.lvim = { style = "lvim", options = { icons_enabled = true, - component_separators = "", - section_separators = "", + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, disabled_filetypes = { "dashboard", "NvimTree", "Outline" }, }, sections = { -- cgit v1.2.3 From d01ba08eaec1640ac2d038893525b3ba0af25813 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Sun, 3 Oct 2021 16:13:46 +0200 Subject: refactor: auto-generate language configuration (#1584) Refactor the monolithic `lvim.lang` design into a more modular approach. IMPORTANT: run `:LvimUpdate` in order to generate the new ftplugin template files. --- lua/core/lualine/components.lua | 3 --- 1 file changed, 3 deletions(-) (limited to 'lua/core/lualine') diff --git a/lua/core/lualine/components.lua b/lua/core/lualine/components.lua index 21e25585..3ee2fdf8 100644 --- a/lua/core/lualine/components.lua +++ b/lua/core/lualine/components.lua @@ -96,14 +96,11 @@ return { local buf_client_names = {} -- add client - local utils = require "lsp.utils" - local active_client = utils.get_active_client_by_ft(buf_ft) for _, client in pairs(buf_clients) do if client.name ~= "null-ls" then table.insert(buf_client_names, client.name) end end - vim.list_extend(buf_client_names, active_client or {}) -- add formatter local formatters = require "lsp.null-ls.formatters" -- cgit v1.2.3