[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/csharp-mode 85d36e1 280/459: Fix lambda indentation #10
From: |
ELPA Syncer |
Subject: |
[elpa] externals/csharp-mode 85d36e1 280/459: Fix lambda indentation #105 |
Date: |
Sun, 22 Aug 2021 13:59:44 -0400 (EDT) |
branch: externals/csharp-mode
commit 85d36e12db854c88202163f912140f9cd5b82a35
Author: Krzysztof Witkowski <krzysztof.witkowski@gmail.com>
Commit: Krzysztof Witkowski <krzysztof.witkowski@gmail.com>
Fix lambda indentation #105
---
csharp-mode.el | 12 ++++++++++--
test-files/indentation-tests.cs | 20 ++++++++++++++------
2 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/csharp-mode.el b/csharp-mode.el
index 85c7745..0fea1d1 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -556,6 +556,10 @@ to work properly with code that includes attributes."
(t nil))
)))
+(defun csharp--at-lambda-header ()
+ "Determines if there is lambda header at point"
+ (or (looking-at "([[:alnum:][:space:]_,]*)[ \t\n]*=>[ \t\n]*{")
+ (looking-at "[[:alnum:]_]+[ \t\n]*=>[ \t\n]*{")))
;; ==================================================================
;; end of csharp-mode utility and feature defuns
@@ -2549,7 +2553,8 @@ are the string substitutions (see `format')."
(> (point) closest-lim))
(not (bobp))
(progn (backward-char)
- (looking-at "[\]\).]\\|\w\\|\\s_"))
+ (or (looking-at "[\]\).]\\|\w\\|\\s_")
+ (looking-at ">")))
(c-safe (forward-char)
(goto-char (scan-sexps (point) -1))))
@@ -2612,7 +2617,10 @@ are the string substitutions (see `format')."
'maybe)
(setq passed-paren (char-after))
'maybe)
- 'maybe))))
+ 'maybe)
+
+ (if (csharp--at-lambda-header)
+ (cons 'inexpr (point))))))
(if (eq res 'maybe)
(when (and c-recognize-paren-inexpr-blocks
diff --git a/test-files/indentation-tests.cs b/test-files/indentation-tests.cs
index 4c32a5a..8d91f78 100644
--- a/test-files/indentation-tests.cs
+++ b/test-files/indentation-tests.cs
@@ -162,21 +162,29 @@ namespace Boo
/* Callback indentation test. */
SomeFunction(() => {
- // empty.
- });
+ System
+ .Console
+ .WriteLine("boo");
+ });
SomeFunction(() =>
{
- // empty.
+ System
+ .Console
+ .WriteLine("boo");
});
SomeFunction((withParam) => {
- // empty.
- });
+ System
+ .Console
+ .WriteLine("boo");
+ });
SomeFunction((withParam) =>
{
- // empty.
+ System
+ .Console
+ .WriteLine("boo");
});
}
- [elpa] externals/csharp-mode 29dab33 255/459: Silence warning in compatibility-shim., (continued)
- [elpa] externals/csharp-mode 29dab33 255/459: Silence warning in compatibility-shim., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 0481983 264/459: Fix indentation behaviour of preprocessor statements., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 4babfff 265/459: Merge branch 'preproc-indentation', ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8100976 267/459: Fix fontification of unsafe methods., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 68a8a69 270/459: Fixed enum indentation level., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 0825112 276/459: Fix CI-error on Emacs 25.x, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode d537cfa 271/459: Add test-case for Enum-indentation., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 981ff38 275/459: Make it easier to reproduce CI errors locally., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 274dd88 273/459: Update CI-settings, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode e7e96e3 272/459: Fixed callback indentation level. (#145), ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 85d36e1 280/459: Fix lambda indentation #105,
ELPA Syncer <=
- [elpa] externals/csharp-mode 4885177 286/459: Merge pull request #161 from ryuslash/fix-package-fontification, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 5a9c8eb 287/459: Merge pull request #159 from ronnieholm/master, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode f640019 285/459: Fix display of ‘package’ as any sort of name, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 7cb8d05 288/459: Update CI settings:, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 44740eb 282/459: Fix font lock breaks on strings #151, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode f6314e5 295/459: Merge pull request #166 from josteink/rework, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode da8eab4 290/459: const is a modifier, not a type., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 5a7828f 298/459: Add xml like doc comments font locking, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode e0a2975 296/459: This is clearly a new version! Lets make it 0.10.0, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8af265d 302/459: Change licenses inside the .el files also, ELPA Syncer, 2021/08/22