Bug 6382 - Unable to change smart indentation once file is created
Summary: Unable to change smart indentation once file is created
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 3.0.x
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2012-08-03 14:28 UTC by Stephen Martin
Modified: 2013-09-04 07:04 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 Stephen Martin 2012-08-03 14:28:00 UTC
Description of Problem:
The smart indentation settings seem to get stuck on whatever they were when the file is created.  Subsequent changes to Indent Width in the project options have no effect.  If you hit enter, the cursor is indented using the original setting.  Choosing Format Document from the Edit menu will adjust the indentation for existing lines, but does not fix the autoindentation setting. 

Steps to reproduce the problem:
1. Go to project options and select an Indent Width of 6.
2. Create a new source file and add it to the solution.  The code stubs will be indented with 6 spaces.
3. Go back to project options and change the Indent Width to 3.
4. Enter some code in one of the method blocks and hit enter.  You will be indented 6 spaces.
5. Select Edit -> Format -> Format Document.  The existing code in the document will be reformatted to 3 space indentation.
6. Enter some code in one of the method blocks and hit enter.  You will be indented 6 space.

Actual Results:
Ending a statement ignores the current setting of Indent Width, and instead uses the setting from when the source file was originally created.

Expected Results:
The auto-indenter will respect the current setting in Indent Width.

How often does this happen? 

Additional Information:
Comment 1 Mike Krüger 2012-08-10 04:02:05 UTC
The typing indenter atm doesn't respect the indent width - but the formatter does.
Comment 2 Mike Krüger 2013-09-04 07:04:22 UTC