Bug 6123 - C# text formatter doesn't allow me to insert arbitrary whitespace
Summary: C# text formatter doesn't allow me to insert arbitrary whitespace
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: Trunk
Hardware: PC Linux
: Normal normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2012-07-14 04:53 UTC by Atsushi Eno
Modified: 2012-07-16 04:07 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 Atsushi Eno 2012-07-14 04:53:01 UTC
I want to fix C# code text format to match whatever original sources use, so I disabled code formatting options, which are 1) on the fly code formatting (unchecked) and 2) text indent mode (None).

But even after I set those values, the TextEditor automatically inserts TAB characters instead of whitespaces I want to paste.


- Create a new console app project.
- Open Main.cs and add text like below, using TABS at each begging of the line:

		public string Foo {
			get { return ""; }

- Now, replace the TABs in the first line with 8 whitespaces.
- Select first 4 of them.
- Type ctrl+x and copy them.
- Go to next line and select those 3 TAB characters.
- Type DELETE to delete them.
- Type ctrl+v to paste the copy buffer.

Actual result:
- It inserts 3 TABs instead of the 4 whitespaces.

Expected result:
- It inserts 4 whitespaces.

Additional notes:
- So it seems that MD ignores my code format settings.
- The copy buffer is correct; move the cursor between " characters in the second line and paste there. 4 whitespaces will appear.
Comment 1 Mike Krüger 2012-07-16 02:03:27 UTC
It's a setting in the text style options, you've to set spaces there.
Comment 2 Atsushi Eno 2012-07-16 02:36:16 UTC
I'm ok with any other option that works for my purpose, but just curious, what is None indent mode for?
Comment 3 Mike Krüger 2012-07-16 04:07:11 UTC
The indent mode is an option mostly for the "return" key.

Only 'Smart' makes sense here in a source code editor. You're looking for the 'use spaces' setting in the text style policy.

btw. Depending if blank lines should be indented or not there is a trailing whitespaces option there as well.