branch: elpa/julia-mode commit 839726af374991223ffe56f7e7d10bef81033d09 Merge: 88d7d87 c45c786 Author: Tamas K. Papp <tkp...@gmail.com> Commit: GitHub <nore...@github.com>
Merge pull request #123 from ronisbr/master Do not consider `:end` as block ending --- julia-mode-tests.el | 19 +++++++++++++++++++ julia-mode.el | 3 +-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/julia-mode-tests.el b/julia-mode-tests.el index 8ca4299..bafff50 100644 --- a/julia-mode-tests.el +++ b/julia-mode-tests.el @@ -433,6 +433,25 @@ function( i=1:2 ) end end") +(ert-deftest julia--test-indent-ignore-:end-as-block-ending () + "Do not consider `:end` as a block ending." + (julia--should-indent + "if a == :end +r = 1 +end" + "if a == :end + r = 1 +end") + + (julia--should-indent + "if a == a[end-4:end] +r = 1 +end" + "if a == a[end-4:end] + r = 1 +end") + ) + (ert-deftest julia--test-symbol-font-locking-at-bol () "Symbols get font-locked at beginning or line." (julia--should-font-lock diff --git a/julia-mode.el b/julia-mode.el index 2282bab..287b4c3 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -411,8 +411,7 @@ Do not move back beyond position MIN." (setq nesting-count (cond ((julia-at-keyword julia-block-start-keywords) (+ nesting-count 1)) - ((and (equal (current-word t) "end") - (not (julia-in-comment))) + ((julia-at-keyword '("end")) (- nesting-count 1)) (t nesting-count)))) (if (> nesting-count 0)