From cfb6e3db145d23308fb855979b80b28b1a33fefa Mon Sep 17 00:00:00 2001 From: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com> Date: Fri, 27 Aug 2021 00:15:18 +0600 Subject: [PATCH] perf: remove ale diagnostics source from default config It is too expensive to check if ale is installed or not when ale is not instaled . It is not that expensive when is is installed. So anyone useing ale can just add ale to sources option in their config. --- README.md | 4 ++-- doc/lualine.txt | 4 ++-- lua/lualine/config.lua | 2 +- lua/tests/spec/config_spec.lua | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d19d8a6..06d0912 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ require'lualine'.setup { sections = { lualine_a = {'mode'}, lualine_b = {'branch', 'diff', - {'diagnostics', sources={'nvim_lsp', 'coc', 'ale'}}}, + {'diagnostics', sources={'nvim_lsp', 'coc'}}}, lualine_c = {'filename'}, lualine_x = {'encoding', 'fileformat', 'filetype'}, lualine_y = {'progress'}, @@ -319,7 +319,7 @@ sections = { 'diagnostics', -- table of diagnostic sources, available sources: -- 'nvim_lsp', 'coc', 'ale', 'vim_lsp' - -- Or a function that returns a table like + -- Or a function that returns a table like -- {error=error_cnt, warning=warn_cnt, info=info_cnt, hint=hint_cnt} sources = {}, -- displays diagnostics from defined severity diff --git a/doc/lualine.txt b/doc/lualine.txt index 8663f4e..a1d2ebc 100644 --- a/doc/lualine.txt +++ b/doc/lualine.txt @@ -49,7 +49,7 @@ Default config~ sections = { lualine_a = {'mode'}, lualine_b = {'branch', 'diff', - {'diagnostics', sources={'nvim_lsp', 'coc', 'ale'}}}, + {'diagnostics', sources={'nvim_lsp', 'coc'}}}, lualine_c = {'filename'}, lualine_x = {'encoding', 'fileformat', 'filetype'}, lualine_y = {'progress'}, @@ -250,7 +250,7 @@ Component specific local options~ 'diagnostics', -- table of diagnostic sources, available sources: -- 'nvim_lsp', 'coc', 'ale', 'vim_lsp' - -- Or a function that returns a table like + -- Or a function that returns a table like -- {error=error_cnt, warning=warn_cnt, info=info_cnt, hint=hint_cnt} sources = {}, -- displays diagnostics from defined severity diff --git a/lua/lualine/config.lua b/lua/lualine/config.lua index d6f0891..74af956 100644 --- a/lua/lualine/config.lua +++ b/lua/lualine/config.lua @@ -11,7 +11,7 @@ local config = { sections = { lualine_a = {'mode'}, lualine_b = {'branch', 'diff', - {'diagnostics', sources={'nvim_lsp', 'coc', 'ale'}}}, + {'diagnostics', sources={'nvim_lsp', 'coc'}}}, lualine_c = {'filename'}, lualine_x = {'encoding', 'fileformat', 'filetype'}, lualine_y = {'progress'}, diff --git a/lua/tests/spec/config_spec.lua b/lua/tests/spec/config_spec.lua index eb66c0d..a9a9e76 100644 --- a/lua/tests/spec/config_spec.lua +++ b/lua/tests/spec/config_spec.lua @@ -110,7 +110,7 @@ describe('config parsing', function() local lualine_default_sections = { lualine_a = {'mode'}, lualine_b = {'branch', 'diff', - {'diagnostics', sources={'nvim_lsp', 'coc', 'ale'}}}, + {'diagnostics', sources={'nvim_lsp', 'coc'}}}, lualine_c = {'filename'}, lualine_x = {'encoding', 'fileformat', 'filetype'}, lualine_y = {'progress'},