Bug 5077 - Virtual indent does not work when tabs-to-spaces is enabled
Summary: Virtual indent does not work when tabs-to-spaces is enabled
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 3.0.x
Hardware: PC Mac OS
: Low normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2012-05-14 17:37 UTC by Aaron Bockover
Modified: 2012-05-16 02:15 UTC (History)
1 user (show)

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

Screen capture of regression (1.14 MB, video/mp4)
2012-05-14 17:37 UTC, Aaron Bockover
Test case (411.30 KB, video/mpeg)
2012-05-15 00:55 UTC, Mike Krüger

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 Aaron Bockover 2012-05-14 17:37:37 UTC
Created attachment 1883 [details]
Screen capture of regression

Without changing any settings, after upgrading to 3.0.1, the feature to strip trailing whitespace does not work at all. I have "Remove trailing whitespace" set on "Text file" from which "C# source code" inherits.

Attached is a screen capture of the feature being broken. I just opened a file, and added some blank lines to an enum and show the diff, which indicates whitespace was not stripped.

Going to Edit->Format->Remove trailing white spaces (interesting that it's a different feature name/label) works as expected, but must be done manually before each save.

I was told that the actual "Remove trailing whitespace" feature was removed in favor of some kind of smart indenting. It's unclear to me what that means or how to turn it on.

The bigger problem is that often in MD, new features are added and/or old ones removed/integrated elsewhere, but no settings migration or effort to preserve the user's intentions is made. This leads to regressions like these, which magnify greatly in a team setting.
Comment 1 Mikayla Hutchinson [MSFT] 2012-05-14 18:21:20 UTC
It looks like the new virtual indent feature doesn't work with tabs-to-spaces enabled.
Comment 2 Mike Krüger 2012-05-15 00:55:27 UTC
Created attachment 1886 [details]
Test case

Works for me. I suspect that the setting is not set.
Check the project policies if the setting is set to remove trailing spaces. 

Is the indent mode set to 'smart' ? It needs to be set to smart as well btw.
Comment 3 Mikayla Hutchinson [MSFT] 2012-05-15 14:44:52 UTC
Here is a demonstration of it working with tabs, then failing with tabs-to-spaces: http://screencast.com/t/9pxp0kbnIHhi

Also, MD seems to be inserting an extra undo step for the tab-to-spaces conversion.
Comment 4 Mike Krüger 2012-05-16 02:15:06 UTC
Reopen the file then it should work.

I fixed the issue with the change of the open file.