Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Description of Problem:
If I have a comment block that is collapsed and a I comment a line of code directly below the comment block, the collapsed comment block will then include the newly commented line in its comment block resulting in the newly comment block disappearing. However, if you start moving the cursor down subsequent lines, you'll see the text editor display the wrong text due to the comment line being consumed by the collapsed comment block.
Steps to reproduce the problem:
1. Put the following code in a method:
1 //var x = 1;
2 //var y = x + 1;
3 var y = x;
2. Collapse the comment block at 'var x = 1;' (Line 1)
3. Comment Line 3 using // (You'll notice a character disappear)
4. Move the cursor with arrow keys to Line 2 (Line 3 will then disappear)
5. Move the cursor to Line 3 again, then to Line 4. You'll now see Console.WriteLine("Test1"); appearing twice.
The text editor will display:
[//var x = 1; ...]
If you continue to move the cursor down, you'll see something like:
[//var x = 1; ...]
The text editor should either not allow comment blocks to pull additional comments into the collapsed section, or it should take that into account when navigating lines. At the very least, duplicate 'ghost' code shouldn't be seen.
How often does this happen?
Moving focus away from MD and back causes the text editor to reset its state correctly.
There is an additional probably related issue with documentation comments:
/// Main class.
1. Collapse the doc comment
2. Move the cursor to the "class MainClass" line
3. Move the cursor to the first position on the line, and then one more char to the left
4. Press enter to get a new line of doc comment.
After a second, a phantom char 's' appears to the right of the cursor. Pressing delete removes the newline. Stepping to the right results in the previously described behavior.
Pressing enter repeatedly and then expanding the doc comment shows that the lines are added to the comment as expected. No 's' chars are included.