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

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

[nongnu] elpa/graphql-mode 5975f0dd5c 3/4: Use graphql-beginning of quer


From: ELPA Syncer
Subject: [nongnu] elpa/graphql-mode 5975f0dd5c 3/4: Use graphql-beginning of query for indentation
Date: Sat, 16 Jul 2022 04:58:34 -0400 (EDT)

branch: elpa/graphql-mode
commit 5975f0dd5cceccb0a7df3fe57c32861e5df265b5
Author: christopher floess <chris.floess@mailbox.org>
Commit: christopher floess <chris.floess@mailbox.org>

    Use graphql-beginning of query for indentation
---
 graphql-mode.el | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/graphql-mode.el b/graphql-mode.el
index 874729a0aa..ffcaf72a76 100644
--- a/graphql-mode.el
+++ b/graphql-mode.el
@@ -157,10 +157,8 @@ Please install it and try again."))
 (defun graphql-beginning-of-query ()
   "Move the point to the beginning of the current query."
   (interactive)
-  (while (and (> (point) (point-min))
-              (or (> (current-indentation) 0)
-                  (> (car (syntax-ppss)) 0)))
-    (forward-line -1)))
+  (goto-char (syntax-ppss-toplevel-pos (syntax-ppss (point-at-bol))))
+  (back-to-indentation))
 
 (defun graphql-end-of-query ()
   "Move the point to the end of the current query."
@@ -284,8 +282,7 @@ Please install it and try again."))
         (column)
         (indent-pos))
     (save-excursion
-      (goto-char (syntax-ppss-toplevel-pos (syntax-ppss (point-at-bol))))
-      (back-to-indentation)
+      (graphql-beginning-of-query)
       (setq column (current-column)))
 
     (save-excursion



reply via email to

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