Skip to content

Commit

Permalink
Merge pull request #123 from ronisbr/master
Browse files Browse the repository at this point in the history
Do not consider `:end` as block ending
  • Loading branch information
tpapp authored May 4, 2020
2 parents 88d7d87 + c45c786 commit 839726a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
19 changes: 19 additions & 0 deletions julia-mode-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions julia-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 839726a

Please sign in to comment.