[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/julia-mode 7802452 263/352: Merge pull request #35 from tp
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/julia-mode 7802452 263/352: Merge pull request #35 from tpapp/fix-10 |
Date: |
Sun, 29 Aug 2021 11:22:58 -0400 (EDT) |
branch: elpa/julia-mode
commit 78024526718479b63fe3804308b65b405a164688
Merge: feb6e79 5812bc3
Author: Jeff Bezanson <jeff.bezanson@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #35 from tpapp/fix-10
Fix indentation for anonymous functions.
---
julia-mode-tests.el | 35 +++++++++++++++++++++++++++++++++++
julia-mode.el | 1 +
2 files changed, 36 insertions(+)
diff --git a/julia-mode-tests.el b/julia-mode-tests.el
index 92c4568..e813657 100644
--- a/julia-mode-tests.el
+++ b/julia-mode-tests.el
@@ -360,6 +360,41 @@ using Foo: bar ,
quux
notpartofit"))
+(ert-deftest julia--test-indent-anonymous-function ()
+ "indentation for function(args...)"
+ (julia--should-indent
+ "function f(x)
+function(y)
+x+y
+end
+end"
+ "function f(x)
+ function(y)
+ x+y
+ end
+end"))
+
+(ert-deftest julia--test-indent-keyword-paren ()
+ "indentation for ( following keywords"
+ "if( a>0 )
+end
+
+ function( i=1:2 )
+ for( j=1:2 )
+ for( k=1:2 )
+ end
+ end
+ end"
+ "if( a>0 )
+end
+
+function( i=1:2 )
+ for( j=1:2 )
+ for( k=1:2 )
+ end
+ end
+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 48cffa5..7b113e4 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -405,6 +405,7 @@ a keyword if used as a field name, X.word, or quoted,
:word."
(and (or (= (point) 1)
(and (not (equal (char-before (point)) ?.))
(not (equal (char-before (point)) ?:))))
+ (not (looking-at "(")) ; handle "function(" when on (
(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"))
- [nongnu] elpa/julia-mode 7c1603c 226/352: Use more common name for indentation setting, (continued)
- [nongnu] elpa/julia-mode 7c1603c 226/352: Use more common name for indentation setting, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode dd3d682 225/352: Fix Emacs 23 error., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 64d86a4 215/352: Added customization options, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c7e3232 218/352: some tuple redesign follow-ups, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 5ee867e 211/352: Changed inferior-julia function in contrib/julia-mode.el to apply, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 0c6673a 212/352: Changed input method for Julia Emacs buffer to TeX, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 6781ef1 220/352: Fix #11673, bad indent after comments ending in =, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 892beb1 231/352: Fix #12528, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 0526f2f 242/352: Fix spelling of 'delimiter', ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 2b15d76 256/352: bol, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 7802452 263/352: Merge pull request #35 from tpapp/fix-10,
ELPA Syncer <=
- [nongnu] elpa/julia-mode 9c36479 264/352: Merge pull request #36 from JuliaEditorSupport/jb/typekeywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode feb6e79 259/352: Merge pull request #31 from RalphAS/custom-lookback, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode b24410f 279/352: Allow user to set multiple arguments to inferior julia, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 04b97c4 269/352: Merge pull request #37 from tpapp/fix-backslash, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 1f254f8 260/352: Fix indentation for anonymous functions., ELPA Syncer, 2021/08/29
- [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