summaryrefslogtreecommitdiff
path: root/lua/core/lualine
diff options
context:
space:
mode:
Diffstat (limited to 'lua/core/lualine')
-rw-r--r--lua/core/lualine/components.lua56
-rw-r--r--lua/core/lualine/styles.lua12
2 files changed, 35 insertions, 33 deletions
diff --git a/lua/core/lualine/components.lua b/lua/core/lualine/components.lua
index 894d9e9b..3ee2fdf8 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,44 +61,46 @@ 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()
- 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 ""
end,
color = { fg = colors.green },
- condition = conditions.hide_in_width,
+ cond = conditions.hide_in_width,
},
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
+ -- TODO: clean up this if statement
+ if type(msg) == "boolean" or #msg == 0 then
+ return "LS Inactive"
+ end
return msg
end
local buf_ft = vim.bo.filetype
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"
@@ -113,10 +116,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: "
@@ -125,16 +128,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 "."
@@ -144,9 +147,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 = {