Bug 4583 - IdeApp.Workbench.OpenDocument() opens at wrong location
Summary: IdeApp.Workbench.OpenDocument() opens at wrong location
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: Trunk
Hardware: PC Windows
: Lowest normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2012-04-22 09:22 UTC by alex
Modified: 2012-04-27 10:53 UTC (History)
2 users (show)

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

Screenshot - it's opened at line 615 but rendered the caret (without clicking after having pressed F12) at line 749 (62.54 KB, image/png)
2012-04-22 09:22 UTC, alex

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 alex 2012-04-22 09:22:02 UTC
Created attachment 1723 [details]
Screenshot - it's opened at line 615 but rendered the caret (without clicking after having pressed F12) at line 749


When my D addin calls

IdeApp.Workbench.OpenDocument(file, 615, 1);

,it opens the file correctly except that it's moving the caret to line 749 aprox. a second later after having opened the target file.
There also is a kind of document viewer artifact which doesn't draw the document content around line 749 correctly - I've got to scroll up and down a bit to let it redraw that document area.

This issue existed even before the huge 2.9.4 merge.

Thx in advance :)
Comment 1 alex 2012-04-22 10:51:10 UTC
It's also worth to mention that there seem to exist two carets, both at line 615 and 749 whereas the highlighing bar (the grey line background) is at line 615.

When I press <Down> it's at line 616, which is totally correct.
Comment 2 Mike Krüger 2012-04-23 02:22:30 UTC
may be a race in the folding - how & when do you set the folded foldings ?
Comment 3 Mike Krüger 2012-04-27 09:38:16 UTC
Fixed - I think you got it working before.

The issue was that the folded foldings were updated on the thread - the folded foldings should be set before the document is shown. That is done with the folding parser.

Now I use the 'normal' parser in case the folding parser isn't implemented - that should fix this issue for languages not implementing a specialized folding parser.
Comment 4 alex 2012-04-27 10:53:01 UTC
(More) perfect :)