Bug 2848 - Line number rendering does do not update after folding
Summary: Line number rendering does do not update after folding
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: Trunk
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2012-01-11 19:01 UTC by Mikayla Hutchinson [MSFT]
Modified: 2012-01-17 17:05 UTC (History)
1 user (show)

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

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 Mikayla Hutchinson [MSFT] 2012-01-11 19:01:59 UTC
When a file is opened and the folding collapses the comment at the top of the file, then the position of the editor changes. It correctly renders the updated text, but not the line numbers. The line numbers only update when the editor is redrawn for some other reason.
Comment 1 Mike Krüger 2012-01-12 04:47:16 UTC
It's caused by: ebab6a1f199c1b293a2eab94a60e469c2ae98f45

That's the downside of having that on a thread, an update could collapse a part of code. This is not a behaviour we should do anyways. Fixing the line numbers don't fix the problem.

Let's have the discussion in #2846 about the whole thing.
Comment 2 Mikayla Hutchinson [MSFT] 2012-01-12 17:19:36 UTC
Er, no. It's a separate bug EXPOSED by that change.

The problem is that when text editor moves and re-renders, the line numbers do not re-render.
Comment 3 Mike Krüger 2012-01-17 17:05:25 UTC
Why does it work now ?

It hasn't to do with text editor movement etc - otherwise you would see that now or when you scroll.

It's simply that if you fill the text editor structure with a folding tree that contains collapsed segments you should do a re-rendering of the text editor. 

Doing re-renderings after each fold tree update is just a waste of cpu power - it tries to "detect" the need of that. However for the first fold update this is not done - the first update is implemented to run on the gui thread before the rendering - the next updates do this update & are started as background worker. 

Therefore the change does more than exposing it - it's using the fold segment update in a way it wasn't built for.

I've implemented a fast parser for the collapsed sections to generate a fold tree, that should fix that - but I added a update when it runs on the main thread as well, then that works anyways.