lsp: fix toggleFormatOnSave (#869)

Co-authored-by: Ching Pei Yang <59727193+horriblename@users.noreply.github.com>
Co-authored-by: raf <raf@notashelf.dev>
This commit is contained in:
Noah765 2025-05-09 01:33:01 +02:00 committed by GitHub
commit 09f2e1d524
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -84,13 +84,13 @@ in {
group = augroup, group = augroup,
buffer = bufnr, buffer = bufnr,
callback = function() callback = function()
if vim.b.disableFormatSave then
return
end
${ ${
if config.vim.lsp.null-ls.enable if config.vim.lsp.null-ls.enable
then '' then ''
if vim.b.disableFormatSave then
return
end
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(