|
195 | 195 | (beginning-of-line) |
196 | 196 | (looking-at "^\s+->.+$"))) |
197 | 197 |
|
| 198 | +(defun elixir-smie-current-line-start-with-pipe-operator-p () |
| 199 | + (save-excursion |
| 200 | + (beginning-of-line) |
| 201 | + (looking-at "^\s*|>.+$"))) |
| 202 | + |
| 203 | +(defun elixir-smie-last-line-is-assignment-p () |
| 204 | + (save-excursion |
| 205 | + (forward-line -1) |
| 206 | + (beginning-of-line) |
| 207 | + (looking-at "^.+=.+$"))) |
| 208 | + |
| 209 | +(defun elixir-smie-last-line-start-with-pipe-operator-p () |
| 210 | + (save-excursion |
| 211 | + (forward-line -1) |
| 212 | + (beginning-of-line) |
| 213 | + (looking-at "^\s*|>.+$"))) |
| 214 | + |
198 | 215 | (defun elixir-smie-line-starts-with-do-colon-p () |
199 | 216 | (save-excursion |
200 | 217 | (beginning-of-line) |
|
305 | 322 | (`(:elem . args) |
306 | 323 | -4) |
307 | 324 | (`(:before . "OP") |
308 | | - (cond ((and (not (smie-rule-hanging-p)) |
309 | | - (smie-rule-prev-p "OP")) |
310 | | - -2) |
311 | | - ((smie-rule-parent-p "def" "defp" "defmacro" "defmacrop") |
312 | | - (smie-rule-parent)))) |
| 325 | + (cond |
| 326 | + ((and (not (smie-rule-hanging-p)) |
| 327 | + (elixir-smie-current-line-start-with-pipe-operator-p) |
| 328 | + (elixir-smie-last-line-is-assignment-p)) |
| 329 | + (smie-rule-parent)) |
| 330 | + ((and (not (smie-rule-hanging-p)) |
| 331 | + (elixir-smie-current-line-start-with-pipe-operator-p)) |
| 332 | + (goto-char (elixir-smie--previous-line-indentation))) |
| 333 | + ((and (not (smie-rule-hanging-p)) |
| 334 | + (smie-rule-prev-p "OP")) |
| 335 | + -2) |
| 336 | + ((smie-rule-parent-p "def" "defp" "defmacro" "defmacrop") |
| 337 | + (smie-rule-parent)) |
| 338 | + (t (smie-rule-parent)))) |
313 | 339 | (`(:before . "def") |
314 | 340 | (cond |
315 | 341 | (t |
|
648 | 674 | ((and (smie-rule-parent-p ";") |
649 | 675 | (smie-rule-hanging-p) |
650 | 676 | (elixir-smie-line-starts-with-do-colon-p)) |
651 | | - (smie-rule-parent (- elixir-smie-indent-basic))))) |
| 677 | + (smie-rule-parent (- elixir-smie-indent-basic))) |
| 678 | + |
| 679 | + ((elixir-smie-current-line-start-with-pipe-operator-p) |
| 680 | + (smie-rule-parent)))) |
652 | 681 | (`(:after . ";") |
653 | 682 | (cond |
654 | 683 | ((smie-rule-parent-p "def") |
|
0 commit comments