From 669a7d63ca6322cb4c760b07c384d1be617d9417 Mon Sep 17 00:00:00 2001 From: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com> Date: Fri, 22 Jul 2022 19:39:52 +0600 Subject: [PATCH] chore: bump stylua version to 14.1 in CI --- .github/workflows/autogen.yml | 2 +- .stylua.toml | 1 + lua/lualine.lua | 7 ++----- lua/lualine/highlight.lua | 9 ++------- lua/lualine/utils/section.lua | 7 ++----- 5 files changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/workflows/autogen.yml b/.github/workflows/autogen.yml index e41c5eb..bde7d91 100644 --- a/.github/workflows/autogen.yml +++ b/.github/workflows/autogen.yml @@ -33,7 +33,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} args: --config-path=.stylua.toml lua/ examples/ - version: 0.12.0 + version: 0.14.1 - name: Push changes uses: stefanzweifel/git-auto-commit-action@v4 with: diff --git a/.stylua.toml b/.stylua.toml index 3f52bf4..420d228 100644 --- a/.stylua.toml +++ b/.stylua.toml @@ -2,3 +2,4 @@ indent_type = "Spaces" indent_width = 2 quote_style = "AutoPreferSingle" call_parentheses = "NoSingleTable" +collapse_simple_statement = "Never" diff --git a/lua/lualine.lua b/lua/lualine.lua index 6c58e21..3e253e9 100644 --- a/lua/lualine.lua +++ b/lua/lualine.lua @@ -162,11 +162,8 @@ local statusline = modules.utils.retry_call_wrap(function(sections, is_focused, for _, section_name in ipairs(section_sequence) do if sections['lualine_' .. section_name] then -- insert highlight+components of this section to status_builder - local section_data = modules.utils_section.draw_section( - sections['lualine_' .. section_name], - section_name, - is_focused - ) + local section_data = + modules.utils_section.draw_section(sections['lualine_' .. section_name], section_name, is_focused) if #section_data > 0 then if not applied_midsection_divider and section_name > 'c' then applied_midsection_divider = true diff --git a/lua/lualine/highlight.lua b/lua/lualine/highlight.lua index 576fb23..20764b5 100644 --- a/lua/lualine/highlight.lua +++ b/lua/lualine/highlight.lua @@ -396,13 +396,8 @@ function M.component_format_highlight(highlight, is_focused) elseif type(color) == 'table' then if not highlight.no_default and not (color.fg and color.bg) then hl_name = append_mode(highlight.name, is_focused) - color = get_default_component_color( - hl_name, - append_mode(''):sub(2), - highlight.section, - color, - highlight.options - ) + color = + get_default_component_color(hl_name, append_mode(''):sub(2), highlight.section, color, highlight.options) end M.highlight(hl_name, color.fg, color.bg, color.gui, color.link) return '%#' .. hl_name .. '#', color diff --git a/lua/lualine/utils/section.lua b/lua/lualine/utils/section.lua index 37fdffc..a288f10 100644 --- a/lua/lualine/utils/section.lua +++ b/lua/lualine/utils/section.lua @@ -47,11 +47,8 @@ function M.draw_section(section, section_name, is_focused) type(section[first_component_no].options.separator) ~= 'table' and (section[1].options.section_separators.left ~= nil and section[1].options.section_separators.left ~= '') then - status[component_no] = string.format( - '%s%%S{%s}', - status[component_no], - section[1].options.section_separators.left - ) + status[component_no] = + string.format('%s%%S{%s}', status[component_no], section[1].options.section_separators.left) end end end