branch: elpa/graphql-mode
commit 3581ad03e04b11c67d4882cbaa9ab6af71eaf78d
Author: Mark Stuart <[email protected]>
Commit: David Vázquez Púa <[email protected]>
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).