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

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

[nongnu] elpa/julia-mode 8818ede 245/352: fix ignoring of keywords insid


From: ELPA Syncer
Subject: [nongnu] elpa/julia-mode 8818ede 245/352: fix ignoring of keywords inside comments
Date: Sun, 29 Aug 2021 11:22:54 -0400 (EDT)

branch: elpa/julia-mode
commit 8818ede7e1bb7d7ab6ce4b5fca6d3c235e21293e
Author: Jeff Bezanson <jeff.bezanson@gmail.com>
Commit: Jeff Bezanson <jeff.bezanson@gmail.com>

    fix ignoring of keywords inside comments
    
    This was part of the fix for 
https://github.com/JuliaLang/julia/issues/15461, but I just noticed that it 
doesn't work due to a mis-nesting of this one clause.
    
    also adds a test for this
---
 julia-mode-tests.el | 8 ++++++++
 julia-mode.el       | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/julia-mode-tests.el b/julia-mode-tests.el
index bd57f17..647323b 100644
--- a/julia-mode-tests.el
+++ b/julia-mode-tests.el
@@ -284,6 +284,14 @@ end"
     end
 end"))
 
+(ert-deftest julia--test-indent-after-commented-keyword ()
+  "Ignore keywords in comments when indenting."
+  (julia--should-indent
+   "# if foo
+a = 1"
+   "# if foo
+a = 1"))
+
 (defun julia--run-tests ()
   (interactive)
   (if (featurep 'ert)
diff --git a/julia-mode.el b/julia-mode.el
index 4e41075..e9a2c0c 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -408,8 +408,8 @@ a keyword if used as a field name, X.word, or quoted, 
:word."
        (member (current-word t) kw-list)
        ;; 'end' is not a keyword when used for indexing, e.g. foo[end-2]
        (or (not (equal (current-word t) "end"))
-           (not (julia-in-brackets))
-           (not (julia-in-comment)))))
+           (not (julia-in-brackets)))
+       (not (julia-in-comment))))
 
 ;; if backward-sexp gives an error, move back 1 char to move over the '('
 (defun julia-safe-backward-sexp ()



reply via email to

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