branch: elpa/rust-mode
commit 1c372492125224625d7f35942f171eb90e22b3f2
Merge: bfe24d2 315cc59
Author: Niko Matsakis <[email protected]>
Commit: Niko Matsakis <[email protected]>
Merge pull request #136 from Stebalien/indent-brace
Re-indent on }
---
rust-mode.el | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/rust-mode.el b/rust-mode.el
index d141a0c..c770f61 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -18,6 +18,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