Bug 10966 - New line break injects into collapsed code
Summary: New line break injects into collapsed code
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 4.0.1
Hardware: Macintosh Mac OS
: Low normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2013-03-07 11:14 UTC by Adam Patridge
Modified: 2013-03-14 04:14 UTC (History)
1 user (show)

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

Screen capture of various situations that do and don't reproduce bug. (1.12 MB, video/mp4)
2013-03-07 11:14 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 2013-03-07 11:14:59 UTC
Created attachment 3549 [details]
Screen capture of various situations that do and don't reproduce bug.

Description of Problem:
In some situations, line break added after a collapsed section of C# code is being injected into the now-expanded section.

Steps to reproduce the problem:
0. Enable code folding, if not already.
1. Collapse a section of code.
2. Put cursor on collapsed section line.
3. Go to the end of collapsed section line using the End (Command+Right) or right arrow.
4. Hit enter.

Actual Results:
The previously-collapsed section is now expanded and the line break is added prior to the last curly brace.

Expected Results:
The line break added at the end of a collapsed section's line of code should be added after the section's last curly brace.

How often does this happen?
It depends on how you get to the end of the collapsed section's line. See attached screen capture video for examples.
* DOES Happens when hitting Command+Right to get to the line end.
* Does NOT happen when getting to the end of the collapsed section from the following line (on following line [in SharpDevelop word break]: Command+Left to get to start of code, Command+Left to get to start of line, left arrow to get to the end of the collapsed section).
* But, it DOES happen when hitting using arrow keys to get to the end of the collapsed line (even coming from following line but going left past the end and coming back)

Additional Information:
Happens under MonoDevelop and SharpDevelop word-break modes.
Comment 1 Mike Krüger 2013-03-14 04:14:14 UTC
was an interesting bug