Bug 12585 - On the fly code formatting takes effect on #if even when turned off
Summary: On the fly code formatting takes effect on #if even when turned off
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 4.0.8
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
Depends on:
Reported: 2013-06-06 17:40 UTC by Jools Adams
Modified: 2013-09-12 05:57 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jools Adams 2013-06-06 17:40:00 UTC
If you have the following file:

public class foo

/// end of file

When you type the 'f' in '#if' it will be reformatted to:

public class foo

/// end of file

Even when Preferences->Text Editor->Behaviour->Enable On The Fly Code Formatting is turned off. I don't expect this to happen.
Comment 1 Mike Krüger 2013-06-07 01:00:24 UTC
It's another part of the code doing that (the indentation engine) that's why it hasn't an effect there.
Comment 2 Jools Adams 2013-06-07 05:54:33 UTC
The behaviour I'm expecting is that the indenter positions the cursor where it wants after I hit return, then leaves alone. Changing the indent when I type the 'f' of '#if' feels like on the fly code formatting, even if it's not the same code under the hood. I reckon most people will feel the same way, but I'm not sure!

On a related note in the Preferences->Source Code->Code Formatting->Indentation there's no configuration option for #if (or #region) indenting. Should I bug that or is it by design?
Comment 3 Mike Krüger 2013-06-07 06:09:09 UTC
You can file a report about it. It's missing - by design - but that doesn't mean that we can't add it.
Atm there are no formatting options for the pre processor directives.
Comment 4 Mike Krüger 2013-09-12 05:57:53 UTC
Formatting options are added - but that option is just for the formatter.