Bug 11641 - Bracket removed occasionally when inserting text right after
Summary: Bracket removed occasionally when inserting text right after
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 4.0.3
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2013-04-08 04:54 UTC by Peter Hultqvist
Modified: 2013-05-10 22:12 UTC (History)
2 users (show)

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

Before (104.18 KB, image/png)
2013-04-08 17:21 UTC, Peter Hultqvist
After Enter is being pressed (104.27 KB, image/png)
2013-04-08 17:21 UTC, Peter Hultqvist

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 Peter Hultqvist 2013-04-08 04:54:58 UTC
This is a frequent occurring issue, several times a day but not easily repeated.

    public void Method(string arg)
        More code here

When pressing enter or pasting content at the cursor location the start bracket is removed:

    public void Method(string arg)

        More code here

When this happen I can undo and repeat it over and over again.
However if I go and do anything else in the document and return the issue is not repeatable.
Comment 1 Mike Krüger 2013-04-08 07:08:22 UTC
When that happens again can you make a screencast ? 

(I can recommend http://www.screencast.com/ and using jing as screencast software)

I could need white spaces turned on in the options when that happens. I guess it may've something to do with the line endings - but so far I had no luck reproducing the described behavior.

Atm I can't think of an action/command/option doing that - we had a remove bracket feature for other constructs.

(btw. it may be that it works better for me because I worked on cut&paste and code formatting/indenting lately)
Comment 2 Peter Hultqvist 2013-04-08 17:21:03 UTC
I managed to trigger it using monodevelop on the git master branch.
I will attach 2 images one is before and the other is after pressing Enter.
After that using ctrl+z return you to an identical version of the first image.

As of writing this I found repeatable instructions :)

The difference is how you set the cursor with your mouse.
If you single click on the position or anywhere right of it, it will work as usual.

However if you click drag as if you would select a bunch of text still only on that line and there is no characters after the {. Then it appears as it should but maybe this time it is a selection rather than a cursor.
Then the bug is repeatable!
Comment 3 Peter Hultqvist 2013-04-08 17:21:22 UTC
Created attachment 3771 [details]
Comment 4 Peter Hultqvist 2013-04-08 17:21:46 UTC
Created attachment 3772 [details]
After Enter is being pressed
Comment 5 Mike Krüger 2013-04-09 08:51:18 UTC
thanks - I don't think I would've found that