chore: format on save off by default

chore: check if table
This commit is contained in:
Christian Chiarulli 2022-11-04 17:04:05 -04:00
parent 57c159fe3c
commit 08d3c056ff
4 changed files with 7 additions and 3 deletions

View file

@ -4,6 +4,8 @@ return {
colorscheme = "lunar",
transparent_window = false,
format_on_save = {
---@usage boolean: format on save (Default: false)
enabled = false,
---@usage pattern string pattern used for the autocommand (Default: '*')
pattern = "*",
---@usage timeout number timeout in ms for the format request (Default: 1000)

View file

@ -158,7 +158,9 @@ function M.disable_format_on_save()
end
function M.configure_format_on_save()
if lvim.format_on_save then
if type(lvim.format_on_save) == "table" and lvim.format_on_save.enabled then
M.enable_format_on_save()
elseif lvim.format_on_save == true then
M.enable_format_on_save()
else
M.disable_format_on_save()

View file

@ -10,7 +10,7 @@ an executable
-- general
lvim.log.level = "warn"
lvim.format_on_save = false
lvim.format_on_save.enabled = false
lvim.colorscheme = "lunar"
-- to disable icons and use a minimalist setup, uncomment the following
-- lvim.use_icons = false

View file

@ -27,7 +27,7 @@ vim.g.clipboard = {
-- general
lvim.log.level = "warn"
lvim.format_on_save = true
lvim.format_on_save.enabled = false
lvim.colorscheme = "lunar"
-- to disable icons and use a minimalist setup, uncomment the following
-- lvim.use_icons = false