|
73 | 73 | ;; open bracket ends the line
|
74 | 74 | (when (not (looking-at "[[:blank:]]*\\(?://.*\\)?$"))
|
75 | 75 | (when (looking-at "[[:space:]]")
|
76 |
| - (forward-word 1) |
77 |
| - (backward-word 1)) |
| 76 | + (forward-word 1) |
| 77 | + (backward-word 1)) |
78 | 78 | (current-column))))
|
79 | 79 |
|
80 | 80 | (defun rust-align-to-method-chain ()
|
81 | 81 | (save-excursion
|
82 |
| - (previous-line) |
83 |
| - (end-of-line) |
84 |
| - (backward-word 1) |
85 |
| - (backward-char) |
86 |
| - (when (looking-at "\\..+\(.*\)\n") |
87 |
| - (- (current-column) rust-indent-offset)))) |
| 82 | + (previous-line) |
| 83 | + (end-of-line) |
| 84 | + (backward-word 1) |
| 85 | + (backward-char) |
| 86 | + (when (looking-at "\\..+\(.*\)\n") |
| 87 | + (- (current-column) rust-indent-offset)))) |
88 | 88 |
|
89 | 89 | (defun rust-rewind-to-beginning-of-current-level-expr ()
|
90 | 90 | (let ((current-level (rust-paren-level)))
|
|
108 | 108 | ;; the inside of it correctly relative to the outside.
|
109 | 109 | (if (= 0 level)
|
110 | 110 | 0
|
111 |
| - (or |
112 |
| - (when rust-indent-method-chain |
113 |
| - (rust-align-to-method-chain)) |
| 111 | + (or |
| 112 | + (when rust-indent-method-chain |
| 113 | + (rust-align-to-method-chain)) |
114 | 114 | (save-excursion
|
115 | 115 | (backward-up-list)
|
116 | 116 | (rust-rewind-to-beginning-of-current-level-expr)
|
|
126 | 126 | ;; A closing brace is 1 level unindended
|
127 | 127 | ((looking-at "}") (- baseline rust-indent-offset))
|
128 | 128 |
|
129 |
| - ;;Line up method chains by their .'s |
130 |
| - ((when (and rust-indent-method-chain |
131 |
| - (looking-at "\..+\(.*\);?\n")) |
132 |
| - (or |
133 |
| - (let ((method-indent (rust-align-to-method-chain))) |
134 |
| - (when method-indent |
135 |
| - (+ method-indent rust-indent-offset))) |
136 |
| - (+ baseline rust-indent-offset)))) |
| 129 | + ;;Line up method chains by their .'s |
| 130 | + ((when (and rust-indent-method-chain |
| 131 | + (looking-at "\..+\(.*\);?\n")) |
| 132 | + (or |
| 133 | + (let ((method-indent (rust-align-to-method-chain))) |
| 134 | + (when method-indent |
| 135 | + (+ method-indent rust-indent-offset))) |
| 136 | + (+ baseline rust-indent-offset)))) |
137 | 137 |
|
138 |
| - |
| 138 | + |
139 | 139 | ;; Doc comments in /** style with leading * indent to line up the *s
|
140 | 140 | ((and (nth 4 (syntax-ppss)) (looking-at "*"))
|
141 | 141 | (+ 1 baseline))
|
|
0 commit comments