diff options
| author | Felix S Klock II <pnkfelix@pnkfx.org> | 2015-04-30 12:31:05 +0200 |
|---|---|---|
| committer | Felix S Klock II <pnkfelix@pnkfx.org> | 2015-04-30 12:31:05 +0200 |
| commit | 493cc99ecad9ee1890007c69d2b500156a78ceeb (patch) | |
| tree | 21da54820b07f491c8178dcb349b77e2edb15322 /rust-mode.el | |
| parent | 2be934c994cf4c5b393e20549ef2ddb26a35cfe3 (diff) | |
| parent | ce976b985875017c64c6d72bc89d915b62063ebf (diff) | |
| download | rust-mode-493cc99ecad9ee1890007c69d2b500156a78ceeb.tar.gz | |
Merge pull request #52 from GBGamer/fix-indent
Fix "-> Type" on a single line indentation
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 53232ec..290dd6b 100644 --- a/rust-mode.el +++ b/rust-mode.el @@ -102,6 +102,9 @@ (defun rust-rewind-to-beginning-of-current-level-expr () (let ((current-level (rust-paren-level))) (back-to-indentation) + (when (looking-at "->") + (rust-rewind-irrelevant) + (back-to-indentation)) (while (> (rust-paren-level) current-level) (backward-up-list) (back-to-indentation)))) @@ -179,7 +182,7 @@ (+ (current-column) rust-indent-offset)))))) (cond ;; Indent inside a non-raw string only if the the previous line - ;; ends with a backslash that is is inside the same string + ;; ends with a backslash that is inside the same string ((nth 3 (syntax-ppss)) (let* ((string-begin-pos (nth 8 (syntax-ppss))) @@ -232,7 +235,7 @@ (or (rust-align-to-expr-after-brace) (+ baseline rust-indent-offset)))) - ;; A closing brace is 1 level unindended + ;; A closing brace is 1 level unindented ((looking-at "}") (- baseline rust-indent-offset)) ;; Doc comments in /** style with leading * indent to line up the *s |
