From be17d1824fe1f6cfd863c2ac7ddad224f7d251cb Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Thu, 26 Dec 2019 09:39:33 +0100 Subject: [PATCH] New eglot-confirm-server-initiated-edits defcustom MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * eglot.el (eglot-confirm-server-initiated-edits): New defcustom. Copyright-paperwork-exempt: yes Co-authored-by: João Távora GitHub-reference: close https://github.com/joaotavora/eglot/issues/382 --- lisp/progmodes/eglot.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 4c0160a5705..df8df13410a 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -193,6 +193,11 @@ let the buffer grow forever." :type '(choice (const :tag "No limit" nil) (integer :tag "Number of characters"))) +(defcustom eglot-confirm-server-initiated-edits 'confirm + "Non-nil if server-initiated edits should be confirmed with user." + :type '(choice (const :tag "Don't show confirmation prompt" nil) + (symbol :tag "Show confirmation prompt" 'confirm))) + ;;; Constants ;;; @@ -1547,7 +1552,7 @@ THINGS are either registrations or unregisterations (sic)." (cl-defmethod eglot-handle-request (_server (_method (eql workspace/applyEdit)) &key _label edit) "Handle server request workspace/applyEdit" - (eglot--apply-workspace-edit edit 'confirm)) + (eglot--apply-workspace-edit edit eglot-confirm-server-initiated-edits)) (defun eglot--TextDocumentIdentifier () "Compute TextDocumentIdentifier object for current buffer." -- 2.39.2