Bug 17896 - Adding line break inside string removes forward whitespace.
Summary: Adding line break inside string removes forward whitespace.
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 4.3.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
Depends on:
Reported: 2014-02-19 17:52 UTC by Adam Patridge
Modified: 2014-03-28 09:13 UTC (History)
2 users (show)

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

Example of in-string whitespace issue. (70.08 KB, image/gif)
2014-02-19 17:52 UTC, Adam Patridge

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 Adam Patridge 2014-02-19 17:52:35 UTC
Created attachment 6095 [details]
Example of in-string whitespace issue.

If I hit Enter in the middle of a hard-coded string variable with any whitespace ahead of the cursor, that whitespace is lost in the resulting two-line concatenated string.

The attached animated GIF shows this in action, but here's a brief description of what it shows.

Given this string in code:

    string something = "This is a long test string.\n        It contains spaces after some line breaks. They go away, though, which is sad.";

If I hit Enter after the `\n`, it will remove all the spaces leading up to the next sentence. This isn't restricted to characters after a newline character, it would also happen if Enter is hit before the space between two words.

If I hit Enter in the middle of those spaces, it preserves any that occur before the cursor and removes any that are after the cursor. If I hit Enter immediately before the new sentence (before "It"), all the space is preserved.
Comment 1 Mike Krüger 2014-02-21 02:54:59 UTC
Comment 2 Sadik Ali 2014-03-28 09:13:23 UTC
I have verified this issue and noticed that all the space is preserved in string when i clicked after \n, middle of spaces, and before the new sentence (before "It") of string mentioned in bug description.

Screen cast: http://screencast.com/t/QVE3AZo97Oc

Build Info:

=== Xamarin Studio ===
Version 4.2.4 (build 266)
Installation UUID: ce3f5199-e126-42fd-bc8a-6a96370af9ab
    Mono 3.2.6 ((no/9b58377)
    GTK+ 2.24.23 (Raleigh theme)

=== Build Information ===
Release ID: 402040266
Git revision: 57fa6b7639703775ae1d5c46536e42ab424cb177
Xamarin addins: eee141c29724a19529e77b8e743086d95b29f5ba

=== Operating System ===
Mac OS X 10.9.2