[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/csharp-mode 31124db 281/459: Merge pull request #156 fr
From: |
ELPA Syncer |
Subject: |
[elpa] externals/csharp-mode 31124db 281/459: Merge pull request #156 from krzsztf/fix-lambda-indentation |
Date: |
Sun, 22 Aug 2021 13:59:44 -0400 (EDT) |
branch: externals/csharp-mode
commit 31124dba6833a4de144ca508edb90d5adfeec209
Merge: 57bd21b 85d36e1
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: GitHub <noreply@github.com>
Merge pull request #156 from krzsztf/fix-lambda-indentation
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 5bfd3d2 257/459: Fix fontification of namespaces in using-statements., (continued)
- [elpa] externals/csharp-mode 5bfd3d2 257/459: Fix fontification of namespaces in using-statements., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 561c359 258/459: Fix fontification in Emacs27., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode c66916e 259/459: Update version/meta-data., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 239527c 263/459: Protect dmode from ccmode monkeypatch (#134), ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode f3aff25 261/459: Try to properly silence warnings., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 643c63e 268/459: Highlight "value" as a constant., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode fcd092d 266/459: Add Emacs 26 to CI., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 2381280 269/459: Remove excess (incorrect) comment., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 30ae136 277/459: Merge pull request #150 from josteink/josteink-CI-fix, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 57bd21b 279/459: Merge pull request #152 from DamienCassou/typos, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 31124db 281/459: Merge pull request #156 from krzsztf/fix-lambda-indentation,
ELPA Syncer <=
- [elpa] externals/csharp-mode ff4111e 278/459: Fix typos, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 9c596c9 283/459: Advice to override only in csharp-mode, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 617dd6d 284/459: Ensure ad-do-it is called on else branch, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 3d02042 291/459: makefile: Make repeated test-runs faster to run., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 072c3dc 292/459: Fix parts of `fontification-of-literals-detects-end-of-strings`, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 2ab4d62 293/459: Remove unused import, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode e79d694 299/459: Add standard query operators kwds, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 608805c 300/459: Relicense to GPLv3, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode c6ec8c2 306/459: Remove before/after functions, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 70d3d89 297/459: Fix cl failure for old cc-mode versions, ELPA Syncer, 2021/08/22