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

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

[nongnu] elpa/julia-mode 8d6ea60 233/352: Fix #11549 (top level after pa


From: ELPA Syncer
Subject: [nongnu] elpa/julia-mode 8d6ea60 233/352: Fix #11549 (top level after paren-indented line)
Date: Sun, 29 Aug 2021 11:22:52 -0400 (EDT)

branch: elpa/julia-mode
commit 8d6ea60566591992487d80479e634746161debd6
Author: Dan Schmidt <dfan@dfan.org>
Commit: Yichao Yu <yyc1992@gmail.com>

    Fix #11549 (top level after paren-indented line)
---
 julia-mode.el | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/julia-mode.el b/julia-mode.el
index 1675c39..27c4dd0 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -452,13 +452,10 @@ with it. Returns nil if we're not within nested parens."
       (save-excursion
         (beginning-of-line)
         (forward-to-indentation 0)
-        (let ((endtok (julia-at-keyword julia-block-end-keywords)))
-          (ignore-errors (+ (julia-last-open-block (- (point) 
julia-max-block-lookback))
-                            (if endtok (- julia-indent-offset) 0)))))
-      ;; Otherwise, use the same indentation as previous line.
-      (save-excursion (forward-line -1)
-                      (current-indentation))
-      0))
+        (let ((endtok (julia-at-keyword julia-block-end-keywords))
+              (last-open-block (julia-last-open-block (- (point) 
julia-max-block-lookback))))
+          (max 0 (+ (or last-open-block 0)
+                    (if endtok (- julia-indent-offset) 0)))))))
     ;; Point is now at the beginning of indentation, restore it
     ;; to its original position (relative to indentation).
     (when (>= point-offset 0)
@@ -622,6 +619,16 @@ c"))
      "
 (1)"))
 
+  (ert-deftest julia--test-top-level-following-paren-indent ()
+    "`At the top level, a previous line indented due to parens should not 
affect indentation."
+    (julia--should-indent
+     "y1 = f(x,
+       z)
+y2 = g(x)"
+     "y1 = f(x,
+       z)
+y2 = g(x)"))
+
   (defun julia--run-tests ()
     (interactive)
     (ert-run-tests-interactively "julia--test")))



reply via email to

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