branch: elpa/julia-mode commit 6add61baef6735d3084d6f1df8e5d21104e2a526 Author: Jeff Bezanson <jeff.bezan...@gmail.com> Commit: Jeff Bezanson <jeff.bezan...@gmail.com>
fix indenting after commented `end` this was broken for me by 0df9ca44c4ba888341801ea00bec6e83ab6b208b --- julia-mode-tests.el | 14 ++++++++++++++ julia-mode.el | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/julia-mode-tests.el b/julia-mode-tests.el index 046c959..61d1d31 100644 --- a/julia-mode-tests.el +++ b/julia-mode-tests.el @@ -315,6 +315,20 @@ a = 1" "# if foo a = 1")) +(ert-deftest julia--test-indent-after-commented-end () + "Ignore `end` in comments when indenting." + (julia--should-indent + "if foo +a = 1 +#end +b = 1 +end" + "if foo + a = 1 + #end + b = 1 +end")) + (ert-deftest julia--test-indent-import-export-using () "Toplevel using, export, and import." (julia--should-indent diff --git a/julia-mode.el b/julia-mode.el index 97f91c2..09c302f 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -454,7 +454,8 @@ Do not move back beyond position MIN." (setq count (cond ((julia-at-keyword julia-block-start-keywords) (+ count 1)) - ((equal (current-word t) "end") + ((and (equal (current-word t) "end") + (not (julia-in-comment))) (- count 1)) (t count)))) (if (> count 0)