branch: externals/csharp-mode commit f9122bbb85d9ffcdd15b3af1e6cb0b0d2968da72 Author: Jostein Kjønigsen <jost...@kjonigsen.net> Commit: Jostein Kjønigsen <jost...@kjonigsen.net>
Fix indentation for array collection initializers. Add test-case to the lot. --- csharp-mode.el | 2 ++ test-files/indentation-tests.cs | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/csharp-mode.el b/csharp-mode.el index 77eb5c6..d0ba8dd 100644 --- a/csharp-mode.el +++ b/csharp-mode.el @@ -486,6 +486,8 @@ to work properly with code that includes attributes. "[A-Za-z_][[:alnum:]]*" ;; optional generic constraint "\\(?:<\\(?:[[:alpha:]][[:alnum:]]*\\)\\(?:[, ]+[[:alpha:]][[:alnum:]]*\\)*>\\)?" + ;; optional array-specifier + "\\(?:\\[\\]\\)?" ;; spacing "[\ t\n\f\v\r]*") nil) (looking-at "[ \t\n\f\v\r]*{")) diff --git a/test-files/indentation-tests.cs b/test-files/indentation-tests.cs index 9715840..4fa4ff5 100644 --- a/test-files/indentation-tests.cs +++ b/test-files/indentation-tests.cs @@ -48,6 +48,16 @@ namespace Boo with = new prop(), }; + var array1 = new ArrayList + { + 1, 2, 3, 4, 5 + }; + + var array2 = new string[] + { + "a", "b", "c" + }; + var map = new Dictionary<int,string> { { 1, "true" }, { 2, "false" },