diff options
| author | Steven Allen <steven@stebalien.com> | 2016-03-07 18:50:05 -0500 |
|---|---|---|
| committer | Steven Allen <steven@stebalien.com> | 2016-03-07 22:12:30 -0500 |
| commit | 315cc59ec5a8dfe3150ce74191da4647fe14c515 (patch) | |
| tree | 0daf744c2281411ca38a6202e8fb2f0935b30d70 | |
| parent | 351732107d4073892b752038228072482b6ebdf6 (diff) | |
| download | rust-mode-315cc59ec5a8dfe3150ce74191da4647fe14c515.tar.gz | |
Re-indent on }
Before:
fn test() {
// Do something
}▎
After:
fn test() {
// Do something
}▎
| -rw-r--r-- | rust-mode.el | 6 |
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 |
