[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/csharp-mode bd42802 216/459: Indentation fix (#88)
From: |
ELPA Syncer |
Subject: |
[elpa] externals/csharp-mode bd42802 216/459: Indentation fix (#88) |
Date: |
Sun, 22 Aug 2021 13:59:30 -0400 (EDT) |
branch: externals/csharp-mode
commit bd4280255ff4752c215468f6b19a002687f600c8
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: GitHub <noreply@github.com>
Indentation fix (#88)
* Add test-case for switch/case indentation-bug.
More info here: https://github.com/josteink/csharp-mode/issues/86
* Allow strings as switch-case values
Closes #86
---
csharp-mode.el | 8 ++++++++
test-files/indentation-tests.cs | 26 ++++++++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/csharp-mode.el b/csharp-mode.el
index 1edc9c8..1093892 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -1395,6 +1395,14 @@ This regexp is assumed to not match any non-operator
identifier."
(c-lang-const c-cpp-matchers)))
+;; allow strings as switch-case values by leaving out string
+;; delimiters in this definition
+(c-lang-defconst c-nonlabel-token-key
+ csharp (c-make-keywords-re t
+ (cl-set-difference (c-lang-const c-keywords)
+ (append (c-lang-const c-label-kwds)
+ (c-lang-const c-protection-kwds))
+ :test 'string-equal)))
(defconst csharp-font-lock-keywords-1 (c-lang-const c-matchers-1 csharp)
"Minimal highlighting for C# mode.")
diff --git a/test-files/indentation-tests.cs b/test-files/indentation-tests.cs
index 8b09dcf..32a93c8 100644
--- a/test-files/indentation-tests.cs
+++ b/test-files/indentation-tests.cs
@@ -79,5 +79,31 @@ namespace Boo
System.Console.WriteLine("boo");
}
}
+
+ public void CaseStamentIndentation()
+ {
+ int bar = 0;
+ switch (foo)
+ {
+ case "foo":
+ bar = 0;
+ break;
+ }
+ switch (bar)
+ {
+ case 1:
+ case 2:
+ bar = 0;
+ break;
+ }
+ switch (foo)
+ {
+ case "foo":
+ case "bar":
+ bar = 0;
+ bar += 1;
+ break;
+ }
+ }
}
}
- [elpa] externals/csharp-mode 9616fd0 192/459: Fix method-name fontification tests., (continued)
- [elpa] externals/csharp-mode 9616fd0 192/459: Fix method-name fontification tests., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 04958ec 198/459: Fix byte-compilation warnings., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 49a957b 199/459: Super-ugly hacks to fix build., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode aa4e5db 201/459: Escape both quoting and quoted double quote, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 48dd7ee 202/459: Remove empty line at file start, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 803a362 203/459: Move log functions back down where they were., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8a9ab5a 204/459: imenu: Add test-cases for generic methods., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode b56c250 205/459: Add fontification tests for generic methods., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode f83e2e3 207/459: Fix indentation of generic type-initializers., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 81cf94d 214/459: Update test-data., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode bd42802 216/459: Indentation fix (#88),
ELPA Syncer <=
- [elpa] externals/csharp-mode 0c4edfd 217/459: Hopefully fix this CI-snafu for now., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 6ccf2cf 219/459: Apply syntax propertize function silently, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 6c0a0d6 220/459: Bump version. Update changelog., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode b87332e 222/459: Update documentation for Emacs 25., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 4516a18 223/459: Fix indentation of generic type-initializers., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode ed7c30c 224/459: WIP: Fix checkdoc- and package-lint errors, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode bbd2888 232/459: Merge branch 'mattiasb-fix-warnings', ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode bc6a419 237/459: Update changelog., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8ab3cc8 239/459: Dirty hack to force type-initializer indentation., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode d39d9ac 241/459: Revert "Make csharp-mode-map inherit from prog-mode-map", ELPA Syncer, 2021/08/22