Skip to content

Re-indent on } #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions rust-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
(require 'url-vars))

(defvar electric-pair-inhibit-predicate)
(defvar electric-indent-chars)

;; for GNU Emacs < 24.3
(eval-when-compile
Expand Down Expand Up @@ -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
Expand Down