From 76e95a02647cd46494173839d574403bf1ed699b Mon Sep 17 00:00:00 2001 From: Micah Chalmer Date: Thu, 5 Sep 2013 22:23:16 -0400 Subject: [PATCH] Indent return type to align with arguments --- src/etc/emacs/rust-mode.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/etc/emacs/rust-mode.el b/src/etc/emacs/rust-mode.el index ff9119250cdd..d7c4142352ec 100644 --- a/src/etc/emacs/rust-mode.el +++ b/src/etc/emacs/rust-mode.el @@ -62,8 +62,11 @@ (back-to-indentation) (let ((level (rust-paren-level))) (cond - ;; A function return type is 1 level indented - ((looking-at "->") (* rust-indent-offset (+ level 1))) + ;; A function return type is indented to the corresponding function arguments + ((looking-at "->") + (save-excursion + (backward-list) + (rust-first-indent-after-brace))) ;; A closing brace is 1 level unindended ((looking-at "}") (* rust-indent-offset (- level 1)))