add min_window_width to all lualine components

This commit is contained in:
2024-11-25 10:06:22 -05:00
parent ab1fab4bdc
commit fbc5118f0e
+26 -11
View File
@@ -75,7 +75,7 @@ return {
}, },
}, },
sections = { sections = {
lualine_a = { 'mode', { cond = custom_components.min_window_width(40) } }, lualine_a = { { 'mode', cond = custom_components.min_window_width(40) } },
lualine_b = { lualine_b = {
{ {
'filename', 'filename',
@@ -86,17 +86,25 @@ return {
modified = '[+]', modified = '[+]',
readonly = '[-]', readonly = '[-]',
}, },
cond = custom_components.min_window_width(100),
}, },
}, },
lualine_c = { lualine_c = {
'branch', {
'branch',
cond = custom_components.min_window_width(180),
},
{ {
'b:gitsigns_head', 'b:gitsigns_head',
icon = '', icon = '',
color = { fg = '#9bcb8b' }, color = { fg = '#9bcb8b' },
{ cond = custom_components.min_window_width(120) }, cond = custom_components.min_window_width(180),
},
{
'diff',
source = custom_components.gitsigns_diff,
cond = custom_components.min_window_width(60),
}, },
{ 'diff', source = custom_components.gitsigns_diff },
}, },
lualine_x = { lualine_x = {
-- TODO: spell indicator (when on) -- TODO: spell indicator (when on)
@@ -109,6 +117,7 @@ return {
--symbols = { error = " ", warn = " ", info = " ", hint = "󰠠 " }, --symbols = { error = " ", warn = " ", info = " ", hint = "󰠠 " },
colored = true, colored = true,
always_visible = false, always_visible = false,
cond = custom_components.min_window_width(120),
}, },
{ {
lazy_status.updates, lazy_status.updates,
@@ -120,12 +129,18 @@ return {
-- return require("auto-session.lib").current_session_name(true) -- return require("auto-session.lib").current_session_name(true)
-- end, -- end,
-- }, -- },
{ custom_components.encoding, { cond = custom_components.min_window_width(120) } }, { custom_components.encoding, { cond = custom_components.min_window_width(190) } },
{ custom_components.fileformat, { cond = custom_components.min_window_width(120) } }, { custom_components.fileformat, { cond = custom_components.min_window_width(180) } },
'filetype', { 'filetype', cond = custom_components.min_window_width(120) },
},
lualine_y = {
{ 'searchcount', cond = custom_components.min_window_width(180) },
{ 'progress', cond = custom_components.min_window_width(180) },
},
lualine_z = {
{ 'selectioncount', cond = custom_components.min_window_width(180) },
{ 'location', cond = custom_components.min_window_width(190) },
}, },
lualine_y = { 'searchcount', 'progress' },
lualine_z = { 'selectioncount', 'location' },
}, },
inactive_sections = { inactive_sections = {
lualine_a = {}, lualine_a = {},
@@ -150,4 +165,4 @@ return {
extensions = { 'nvim-tree', 'lazy', 'trouble', 'quickfix', 'fzf', 'mason' }, extensions = { 'nvim-tree', 'lazy', 'trouble', 'quickfix', 'fzf', 'mason' },
}) })
end, end,
} }