emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/julia-mode 6add61b 254/352: fix indenting after commented


From: ELPA Syncer
Subject: [nongnu] elpa/julia-mode 6add61b 254/352: fix indenting after commented `end`
Date: Sun, 29 Aug 2021 11:22:56 -0400 (EDT)

branch: elpa/julia-mode
commit 6add61baef6735d3084d6f1df8e5d21104e2a526
Author: Jeff Bezanson <jeff.bezanson@gmail.com>
Commit: Jeff Bezanson <jeff.bezanson@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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]