Sfoglia il codice sorgente

[bugfix] Update lualine according to the breaking changes (#1558)

Abouzar Parvan 3 anni fa
parent
commit
df0da6fc75
3 ha cambiato i file con 28 aggiunte e 29 eliminazioni
  1. 22 22
      lua/core/lualine/components.lua
  2. 6 6
      lua/core/lualine/styles.lua
  3. 0 1
      lua/plugins.lua

+ 22 - 22
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,
   },
 }

+ 6 - 6
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 = {

+ 0 - 1
lua/plugins.lua

@@ -131,7 +131,6 @@ return {
     -- "hoob3rt/lualine.nvim",
     "shadmansaleh/lualine.nvim",
     -- "Lunarvim/lualine.nvim",
-    commit = "62bfe80fb6e0cd51cec6fc9df9e1768f7d37d299",
     config = function()
       require("core.lualine").setup()
     end,