diff options
| author | Micah Chalmer <micah@micahchalmer.net> | 2013-09-05 22:23:16 -0400 |
|---|---|---|
| committer | Micah Chalmer <micah@micahchalmer.net> | 2013-09-06 01:02:19 -0400 |
| commit | 9640fe89c1e15c869500cf1057fd40c7b1c4fd10 (patch) | |
| tree | be9e44328122d11bb21d6753347628e2f13ed228 /rust-mode.el | |
| parent | 2765de71a30bcd24a9e433add88953148c602444 (diff) | |
| download | rust-mode-9640fe89c1e15c869500cf1057fd40c7b1c4fd10.tar.gz | |
Indent return type to align with arguments
Diffstat (limited to 'rust-mode.el')
| -rw-r--r-- | rust-mode.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/rust-mode.el b/rust-mode.el index ff91192..d7c4142 100644 --- a/rust-mode.el +++ b/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))) |
