branch: elpa/graphql-mode
commit 66efefd508a4e479715ea486ca46e1e3a6318b5d
Author: David Vazquez Pua <[email protected]>
Commit: David Vazquez Pua <[email protected]>
Add customization group and variable to customize indentation level
The user now can customize `graphql-indent-level' to change the
indentation level for GraphQL code.
---
graphql-mode.el | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/graphql-mode.el b/graphql-mode.el
index 6b787d956a..c3a281d304 100644
--- a/graphql-mode.el
+++ b/graphql-mode.el
@@ -41,6 +41,20 @@
(require 'url)
(require 'cl-lib)
+
+;;; User Customizations:
+
+(defgroup graphql nil
+ "Major mode for editing GraphQL schemas and queries."
+ :tag "GraphQL"
+ :group 'languages)
+
+(defcustom graphql-indent-level 2
+ "Number of spaces for each indentation step in `graphql-mode'."
+ :type 'integer
+ :safe 'integerp)
+
+
(defvar graphql-url
nil)
(make-variable-buffer-local 'graphql-url)
@@ -121,7 +135,7 @@ response from the server."
(when (looking-at "\\s-*\\s)")
(setq level (1- level)))
- (indent-line-to (* 2 level))
+ (indent-line-to (* graphql-indent-level level))
(setq indent-pos (point))))
(when (< position indent-pos)