From 658dc84ea313fc7f76309fc7d7ae260bc8e05e50 Mon Sep 17 00:00:00 2001
From: Liam <LiamBowen@gmail.com>
Date: Sun, 12 Jun 2022 16:31:44 -0400
Subject: [PATCH] Disable super-save on go-mode

Fixes https://github.com/bbatsov/prelude/issues/1372
---
 modules/prelude-go.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/prelude-go.el b/modules/prelude-go.el
index 13116c5..e8030ab 100644
--- a/modules/prelude-go.el
+++ b/modules/prelude-go.el
@@ -45,6 +45,12 @@
 
 (define-key 'help-command (kbd "G") 'godoc)
 
+;; Fix: super-save will cause go files to be saved when lsp-mode does
+;; certain things, triggering lsp-format-buffer. This causes, inter alia,
+;; commas to disappear when typing go function invocations
+(add-to-list 'super-save-predicates
+             (lambda () (not (eq major-mode 'go-mode))))
+
 (with-eval-after-load 'go-mode
   (defun prelude-go-mode-defaults ()
     ;; Add to default go-mode key bindings