summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rust-mode.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/rust-mode.el b/rust-mode.el
index 56657d6..632c380 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -19,6 +19,7 @@
(require 'url-vars))
(defvar electric-pair-inhibit-predicate)
+(defvar electric-indent-chars)
;; for GNU Emacs < 24.3
(eval-when-compile
@@ -1299,6 +1300,11 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
(setq-local comment-end "")
(setq-local indent-tabs-mode nil)
+ ;; Auto indent on }
+ (setq-local
+ electric-indent-chars (cons ?} (and (boundp 'electric-indent-chars)
+ electric-indent-chars)))
+
;; Allow paragraph fills for comments
(setq-local comment-start-skip "\\(?://[/!]*\\|/\\*[*!]?\\)[[:space:]]*")
(setq-local paragraph-start