emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/graphql-mode 3581ad03e0 094/122: Allow *GraphQL* response


From: ELPA Syncer
Subject: [nongnu] elpa/graphql-mode 3581ad03e0 094/122: Allow *GraphQL* response buffer to be closed with "q" key
Date: Sat, 29 Jan 2022 08:03:37 -0500 (EST)

branch: elpa/graphql-mode
commit 3581ad03e04b11c67d4882cbaa9ab6af71eaf78d
Author: Mark Stuart <codeasone@gmail.com>
Commit: David Vázquez Púa <davazp@gmail.com>

    Allow *GraphQL* response buffer to be closed with "q" key
---
 graphql-mode.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/graphql-mode.el b/graphql-mode.el
index 8c81046071..06793d24a1 100644
--- a/graphql-mode.el
+++ b/graphql-mode.el
@@ -189,6 +189,13 @@ Please install it and try again."))
         (error nil))
     nil))
 
+(define-minor-mode graphql-query-response-mode
+  "Allows GraphQL query response buffer to be closed with (q)"
+  :lighter " GraphQL Response"
+  :keymap (let ((map (make-sparse-keymap)))
+            (define-key map (kbd "q") 'quit-window)
+            map))
+
 (defun graphql-send-query ()
   "Send the current GraphQL query/mutation/subscription to server."
   (interactive)
@@ -212,7 +219,8 @@ Please install it and try again."))
          (insert "\n\n"
                  (propertize (request-response--raw-header response)
                              'face 'font-lock-comment-face
-                             'font-lock-face 'font-lock-comment-face)))))
+                             'font-lock-face 'font-lock-comment-face))
+         (graphql-query-response-mode))))
     ;; If the query was successful, then save the value of graphql-url
     ;; in the current buffer (instead of the introduced local
     ;; binding).



reply via email to

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