diff --git a/elixir-smie.el b/elixir-smie.el index e1d75bc2..5a24ed1c 100644 --- a/elixir-smie.el +++ b/elixir-smie.el @@ -117,10 +117,12 @@ Return non-nil if any line breaks were skipped." (block elixir-smie-next-token-no-lookaround ;; First, skip comments; but if any comments / newlines were ;; skipped, the upper level needs to check if they were significant: - (when (if forwardp + + (when + (if forwardp (elixir-skip-comment-forward) (elixir-skip-comment-backward)) - (return-from elixir-smie-next-token-no-lookaround "\n")) + (return-from elixir-smie-next-token-no-lookaround "\n")) (let* ((found-token-class (find-if (lambda (class-def) (let ((regex (symbol-value (car class-def)))) @@ -292,6 +294,12 @@ Return non-nil if any line breaks were skipped." elixir-smie-indent-basic)) (`(,_ . ,(or `"COMMA")) (smie-rule-separator kind)) (`(:after . "=") elixir-smie-indent-basic) + (`(:after . "end") + ;; dont't increase the indent level after an 'end' was seen. + ;; FIXME: This is just a woraround to do the right thing under + ;; normal circumstances Once the problem with newline assessment + ;; is (#5 and #18 !?) fixed, this should be unnecessary + 0) (`(:after . ,(or `"do")) elixir-smie-indent-basic) (`(:list-intro . ,(or `"do"))