From 09f2e1d5245c5e9d35e6b451d47affec0c006157 Mon Sep 17 00:00:00 2001 From: Noah765 <99338019+Noah765@users.noreply.github.com> Date: Fri, 9 May 2025 01:33:01 +0200 Subject: [PATCH] lsp: fix toggleFormatOnSave (#869) Co-authored-by: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Co-authored-by: raf --- modules/plugins/lsp/config.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/plugins/lsp/config.nix b/modules/plugins/lsp/config.nix index 3702ac5f..c2320aaf 100644 --- a/modules/plugins/lsp/config.nix +++ b/modules/plugins/lsp/config.nix @@ -84,13 +84,13 @@ in { group = augroup, buffer = bufnr, callback = function() + if vim.b.disableFormatSave then + return + end + ${ if config.vim.lsp.null-ls.enable then '' - if vim.b.disableFormatSave then - return - end - local function is_null_ls_formatting_enabled(bufnr) local file_type = vim.api.nvim_buf_get_option(bufnr, "filetype") local generators = require("null-ls.generators").get_available(