Skip to content

Commit

Permalink
If the previous line has a trailing =, that should take precedence ov…
Browse files Browse the repository at this point in the history
…er blocks.
  • Loading branch information
Wilfred committed Nov 11, 2014
1 parent f20e3d9 commit 8449a44
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions contrib/julia-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -364,13 +364,6 @@ before point. Returns nil if we're not within nested parens."
(save-excursion
(beginning-of-line)
(ignore-errors (julia-paren-indent)))
;; Indent according to how many nested blocks we are in.
(save-excursion
(beginning-of-line)
(forward-to-indentation 0)
(let ((endtok (julia-at-keyword julia-block-end-keywords)))
(ignore-errors (+ (julia-last-open-block (point-min))
(if endtok (- julia-basic-offset) 0)))))
;; If the previous line ends in =, increase the indent.
(ignore-errors ; if previous line is (point-min)
(save-excursion
Expand All @@ -381,6 +374,13 @@ before point. Returns nil if we're not within nested parens."
(equal (char-after (point)) ?=)))
(+ julia-basic-offset (current-indentation))
nil)))
;; Indent according to how many nested blocks we are in.
(save-excursion
(beginning-of-line)
(forward-to-indentation 0)
(let ((endtok (julia-at-keyword julia-block-end-keywords)))
(ignore-errors (+ (julia-last-open-block (point-min))
(if endtok (- julia-basic-offset) 0)))))
;; Otherwise, use the same indentation as previous line.
(save-excursion (forward-line -1)
(current-indentation))
Expand Down

0 comments on commit 8449a44

Please sign in to comment.