[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/julia-mode 0eec10a 333/352: Do not consider `:end` as bloc
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/julia-mode 0eec10a 333/352: Do not consider `:end` as block ending |
Date: |
Sun, 29 Aug 2021 11:23:13 -0400 (EDT) |
branch: elpa/julia-mode
commit 0eec10a93a32d10a0f7402cab6d3958b2ae3962c
Author: Ronan Arraes Jardim Chagas <ronisbr@gmail.com>
Commit: Ronan Arraes Jardim Chagas <ronisbr@gmail.com>
Do not consider `:end` as block ending
The word `:end` was being considered as a block ending. Hence, the
following code:
if a == :end
r = 1
end
was being incorrectly indented:
if a == :end
r = 1
end
Closes #122
---
julia-mode-tests.el | 10 ++++++++++
julia-mode.el | 4 +++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/julia-mode-tests.el b/julia-mode-tests.el
index 8ca4299..6d326a9 100644
--- a/julia-mode-tests.el
+++ b/julia-mode-tests.el
@@ -433,6 +433,16 @@ 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"))
+
(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..d9bb6c3 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -412,7 +412,9 @@ Do not move back beyond position MIN."
(cond ((julia-at-keyword julia-block-start-keywords)
(+ nesting-count 1))
((and (equal (current-word t) "end")
- (not (julia-in-comment)))
+ (not (julia-in-comment))
+ ;; Do not consider the symbol `:end` a block ending.
+ (not (equal (char-before (point)) ?:)))
(- nesting-count 1))
(t nesting-count))))
(if (> nesting-count 0)
- [nongnu] elpa/julia-mode 5812bc3 261/352: Added tests for parentheses following keywords., (continued)
- [nongnu] elpa/julia-mode 5812bc3 261/352: Added tests for parentheses following keywords., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode b99710c 251/352: `python-mode`-like paren-indent, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 483805b 257/352: Merge pull request #29 from nverno/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 9f990bb 281/352: Handle string escapes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 2ef6992 278/352: Fixed import export etc indentation at start of buffer. (#47), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 117b791 294/352: Replace `Associative` by `AbstractDict` (thanks to @tpapp), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode dc21978 289/352: Merge pull request #63 from nverno/movement-functions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 61e22f6 312/352: Merge pull request #90 from tpapp/tp/add-melpa-badge, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode a174d0e 315/352: Fix indentation of generated elisp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 97325c4 318/352: Merge pull request #87 from tpapp/tp/drop-emacs-23, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 0eec10a 333/352: Do not consider `:end` as block ending,
ELPA Syncer <=
- [nongnu] elpa/julia-mode c9d8230 329/352: Give \ punctuation syntax outside of strings (#113), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 6b7e956 321/352: Fix for derived parent mode (#66), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 9dcabbc 334/352: Simplify the logic to find the end of last block, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 796ddfd 338/352: Apply proper syntax to triple-quoted cmds, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 505d71b 339/352: Add all problemmatic strings from issue #15 to tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode b800403 326/352: Font lock tweaks (#102), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 8bfc709 325/352: bump version for release, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode a31868d 340/352: font-lock ccall as a builtin, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode a4eeb6c 343/352: Merge pull request #134 from non-Jedi/font-lock-builtin-face, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode a1ba9a0 352/352: add logo, README tweaks, add section on testing (#163), ELPA Syncer, 2021/08/29