I am struggling to get Xamarin Studio to stop screwing up my preferred indentation in lambdas. Consider this block of code:
UIView.Animate(duration, () =>
{
view.Alpha = 0;
}, null);
I realize that not everyone agrees on how those braces should be indented, but when you are in Visual Studio and hit enter after =>
it indents, and it does not change that indentation after entering braces. That is, Visual Studio seems to think that block should be indented, and I prefer it that way too.
The problem is that Xamarin Studio disagrees, and when I type code inside that block it absolutely insists on unindenting those lines (the lines inside the braces, not the braces themselves), which means that the code inside the block is at the same indentation level as the braces themselves. That's wrong. I cannot seem to convince it to stop doing that. I will undo it and then as soon as I type in another punctuation mark it moves it right back. WTF?
This only happens if I use the "Smart" indentation mode (Text Editor->Behavior), but if I change it to anything else then I get other undesired behavior (https://bugzilla.xamarin.com/show_bug.cgi?id=18228). I'm trying to figure out if there is some way to control how Xamarin Studio wants to indent these anonymous methods so that it matches what Visual Studio does by default.