Skip to content

Commit a163037

Browse files
committed
Add a SMIE rule function for "def" tokens.
This function now explicitly sets the indentation level of lines beginning with "def" to 2. Formerly, this token returned `nil` (the default, because there was no matching pattern in `elixir-smie-rules`), which caused SMIE to call `smie-indent-after-keyword` to calculate the indentation. This function was returning the incorrect value which was causing the inappropriate alignment to the `.`.
1 parent bf2842d commit a163037

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

elixir-smie.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ Return non-nil if any line breaks were skipped."
295295
(`(:after . "OP")
296296
(unless (smie-rule-sibling-p)
297297
elixir-smie-indent-basic))
298-
(`(:before. "OP")
298+
(`(:before . "def") elixir-smie-indent-basic)
299+
(`(:before . "OP")
299300
;; FIXME: Issue #5: This should prevent comments on lines before
300301
;; continuation lines from causing indentation messed-upness, but
301302
;; for some reason SMIE doesn't look this far when there's a

0 commit comments

Comments
 (0)