From 6c9330d240ed934329b44f5c0c3220060ca58f9a Mon Sep 17 00:00:00 2001 From: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com> Date: Sat, 28 Aug 2021 01:06:19 +0600 Subject: [PATCH] Enhance: Truncate from section c this way a&b won't disapear when stl becomes wide --- lua/lualine/init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lualine/init.lua b/lua/lualine/init.lua index 5411887..1829615 100644 --- a/lua/lualine/init.lua +++ b/lua/lualine/init.lua @@ -103,6 +103,7 @@ local function statusline(sections, is_focused) local section_sequence = {'a', 'b', 'c', 'x', 'y', 'z'} local status = {} local applied_midsection_devider = false + local applied_trunc = false for _, section_name in ipairs(section_sequence) do if sections['lualine_' .. section_name] then -- insert highlight+components of this section to status_builder @@ -114,6 +115,10 @@ local function statusline(sections, is_focused) applied_midsection_devider = true section_data = '%='..section_data end + if not applied_trunc and section_name > 'b' then + applied_trunc = true + section_data = '%<'..section_data + end table.insert(status, section_data) end end