From 195b6848d2b1e0a49aa554ee931d24192c818f39 Mon Sep 17 00:00:00 2001 From: Nick Jensen Date: Thu, 29 Aug 2024 09:41:41 +1200 Subject: [PATCH 1/2] setlocal cinoptions=J1 --- ftplugin/cs.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ftplugin/cs.vim b/ftplugin/cs.vim index 0734d11..1010863 100644 --- a/ftplugin/cs.vim +++ b/ftplugin/cs.vim @@ -21,6 +21,8 @@ setlocal formatoptions-=t formatoptions+=croql " Set 'comments' to format dashed lists in comments. setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,:// +setlocal cinoptions=J1 + let b:undo_ftplugin = 'setl com< fo<' if exists('loaded_matchit') && !exists('b:match_words') From 5f3294ca67d4b6072e87a2cc28595e3105ae4a32 Mon Sep 17 00:00:00 2001 From: Nick Jensen Date: Thu, 29 Aug 2024 10:01:50 +1200 Subject: [PATCH 2/2] Add test for cino-J --- test/indent.vader | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/indent.vader b/test/indent.vader index 19a2dc1..00beae3 100644 --- a/test/indent.vader +++ b/test/indent.vader @@ -74,3 +74,20 @@ Expect cs(correct indentation): string m_PrettyName = ""; } } + +Given cs (an object initialization with more than one property): + return new LoginResponse + { + Success = false, + Message = _frameworkSettings.InvalidLoginErrorMessage + }; + +Execute: + normal! gg=G + +Expect cs(correct indentation): + return new LoginResponse + { + Success = false, + Message = _frameworkSettings.InvalidLoginErrorMessage + };