[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/julia-mode 7b1d3fb 253/352: Merge pull request #21 from ks
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/julia-mode 7b1d3fb 253/352: Merge pull request #21 from kshramt/python-paren-indent |
Date: |
Sun, 29 Aug 2021 11:22:56 -0400 (EDT) |
branch: elpa/julia-mode
commit 7b1d3fb053c32d9affe82fbf20cc0f8795f45026
Merge: a95b06b b99710c
Author: Yichao Yu <yyc1992@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #21 from kshramt/python-paren-indent
`python-mode`-like paren-indent
---
julia-mode-tests.el | 23 +++++++++++++++++++++++
julia-mode.el | 22 +++++++++++++++++++---
2 files changed, 42 insertions(+), 3 deletions(-)
diff --git a/julia-mode-tests.el b/julia-mode-tests.el
index faeaf66..046c959 100644
--- a/julia-mode-tests.el
+++ b/julia-mode-tests.el
@@ -183,6 +183,29 @@ baz )"
foobar( bar,
baz )"))
+(ert-deftest julia--test-indent-paren-newline ()
+ "python-mode-like indentation."
+ (julia--should-indent
+ "
+foobar(
+bar,
+baz)"
+ "
+foobar(
+ bar,
+ baz)")
+ (julia--should-indent
+ "
+foobar(
+bar,
+baz
+)"
+ "
+foobar(
+ bar,
+ baz
+)"))
+
(ert-deftest julia--test-indent-equals ()
"We should increase indent on a trailing =."
(julia--should-indent
diff --git a/julia-mode.el b/julia-mode.el
index a8ab0c6..97f91c2 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -496,10 +496,26 @@ with it. Returns nil if we're not within nested parens."
((= (nth 0 parser-state) 0) nil) ;; top level
(t
(ignore-errors ;; return nil if any of these movements fail
- (backward-up-list)
- (forward-char)
+ (beginning-of-line)
(skip-syntax-forward " ")
- (current-column)))))))
+ (let ((possibly-close-paren-point (point)))
+ (backward-up-list)
+ (let ((open-paren-point (point)))
+ (forward-char)
+ (skip-syntax-forward " ")
+ (if (eolp)
+ (progn
+ (up-list)
+ (backward-char)
+ (let ((paren-closed (= (point)
possibly-close-paren-point)))
+ (goto-char open-paren-point)
+ (beginning-of-line)
+ (skip-syntax-forward " ")
+ (+ (current-column)
+ (if paren-closed
+ 0
+ julia-indent-offset))))
+ (current-column))))))))))
(defun julia-prev-line-skip-blank-or-comment ()
"Move point to beginning of previous line skipping blank lines
- [nongnu] elpa/julia-mode ff5fc36 202/352: julia-mode.el: allow space or no space after :: and <:, (continued)
- [nongnu] elpa/julia-mode ff5fc36 202/352: julia-mode.el: allow space or no space after :: and <:, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 05f002c 203/352: When indenting code, limit how far back we search., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 70bbe82 204/352: Adding unit tests for indentation., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode ff8adf5 221/352: Add tests for #11684. [ci skip], ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 8ab2a60 222/352: julia-paren-indent skips blanks after paren, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c8dfbe2 227/352: Declare indentation as customizable, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 011435c 237/352: julia-mode: Fix indent for hanging ops and module, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c2f0ed8 235/352: julia-mode: Fix prompt regexp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode a95b06b 252/352: Merge pull request #20 from tpapp/indent-export, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 847908e 249/352: Add indent for import and export., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 7b1d3fb 253/352: Merge pull request #21 from kshramt/python-paren-indent,
ELPA Syncer <=
- [nongnu] elpa/julia-mode f591c6d 275/352: Merge pull request #41 from rfourquet/rf/where-return, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 8449c95 295/352: Merge pull request #69 from emmt/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 47d2fb0 282/352: Merge pull request #51 from non-Jedi/arg-list, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode e27e6d2 290/352: fix compilation error, silence byte-compiler warnings in emacs>23, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 7102542 304/352: fix tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 646f758 156/352: Don't skip over end keywords., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 11e3904 176/352: Backporting regexp-opt functionality to Emacs 23., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 36aa038 181/352: Fix julia-in-brackets so it isn't confused by strings, characters or comments., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode d7a7607 184/352: Make julia-last-open-block-pos a pure function that only returns the position., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 3597e9a 186/352: Comment improvements., ELPA Syncer, 2021/08/29