lsp: fix toggleFormatOnSave

This commit is contained in:
Noah765 2025-04-30 10:35:58 +02:00
commit 8ce85f5955

View file

@ -84,13 +84,13 @@ in {
group = augroup, group = augroup,
buffer = bufnr, buffer = bufnr,
callback = function() callback = function()
${
if config.vim.lsp.null-ls.enable
then ''
if vim.b.disableFormatSave then if vim.b.disableFormatSave then
return return
end end
${
if config.vim.lsp.null-ls.enable
then ''
local function is_null_ls_formatting_enabled(bufnr) local function is_null_ls_formatting_enabled(bufnr)
local file_type = vim.api.nvim_buf_get_option(bufnr, "filetype") local file_type = vim.api.nvim_buf_get_option(bufnr, "filetype")
local generators = require("null-ls.generators").get_available( local generators = require("null-ls.generators").get_available(