[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eglot 097eed5 31/54: Close #382: new eglot-confirm-serv

From: João Távora
Subject: [elpa] externals/eglot 097eed5 31/54: Close #382: new eglot-confirm-server-initiated-edits defcustom
Date: Thu, 16 Apr 2020 05:31:50 -0400 (EDT)

branch: externals/eglot
commit 097eed5337288cecd6e1db7bfd8496b4a16aa539
Author: Theodor Thornhill <address@hidden>
Commit: João Távora <address@hidden>

    Close #382: new eglot-confirm-server-initiated-edits defcustom
    * eglot.el (eglot-confirm-server-initiated-edits): New defcustom.
    Copyright-paperwork-exempt: yes
    Co-authored-by: João Távora <address@hidden>
 README.md | 3 +++
 eglot.el  | 7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 9045d12..98e2f0e 100644
--- a/README.md
+++ b/README.md
@@ -273,6 +273,9 @@ documentation on what these do.
 - `eglot-auto-display-help-buffer`: If non-nil, automatically display
   `*eglot-help*` buffer;
+- `eglot-confirm-server-initiated-edits`: If non-nil, ask for confirmation 
+  before allowing server to edit the source buffer's text;
 There are a couple more variables that you can customize via Emacs
diff --git a/eglot.el b/eglot.el
index 4c0160a..df8df13 100644
--- a/eglot.el
+++ b/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 
 (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."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]