Bug 2275 - Lines of code shift and duplicate
Summary: Lines of code shift and duplicate
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 2.8
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2011-11-30 14:44 UTC by René Ruppert
Modified: 2011-12-11 15:43 UTC (History)
3 users (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 René Ruppert 2011-11-30 14:44:36 UTC
Sometimes (sorry, don't know how to repro, but it seems to have to do with code/comment folding), MD 2.8 shifts text lines.
This means: some block is collapsed and I move the cursor one line up. The editor will then show the current line shifted one line higher.
So I will see this line twice.
The opposite is true when using cursor down: the next line vanishes.

Unfolding all collapsed text blocks or restarting MD solves the issue.
Comment 1 Nicolas 2011-12-06 16:37:17 UTC
This affects me as well with Monodevelop 2.6 from repositories of Ubuntu Oneiric.
And for me its even worse as it happens nearly always. There are other strange things going on as e. g. the click of my mouse is applied several lines above.

I noticed this behaviour with Monodevelop 2.4 at Ubuntu Natty as well - but there this occurred rarely only.

Currently I don't know how I can use Monodevelop while having anything folded (it seems that the problem does not occur if nothing is folded)

Though I have no clue what the reason is, I will try to list everything what may have an impact:
- heavy use of #region
- use of #if
- Compiz activated with many effects
- Many screenlets
- nvidia graphics card with driver 280.13
- deactivating source code highlightning makes no difference
- getting this error all the time:
System.NullReferenceException: Object reference not set to an instance of an object
  at GLib.Object.NotifyCallback (IntPtr handle, IntPtr pspec, IntPtr gch) [0x00000] in <filename unknown>:0 

...any hint/help/trick or debugging strategy?
Comment 2 Mike Krüger 2011-12-11 04:41:48 UTC
I recommend updating to newer 2.8.x builds. 

2.6 is worse - the virtual line/space calculation code was rewritten in the 2.8 line, however each 2.8.x release contains some bugfixes in that area.

The "NotifyCallback" thing is something that has to do with gnome3. The 2.8 line contains some work-arounds for that as well. Atm I work on linux mint 12 and don't get any of these anymore.
Comment 3 Nicolas 2011-12-11 15:43:54 UTC
This is good news, I also switched to Linux Mint 12 recently
But 2.8 is not available for all Linux currently and I am afraid of compiling Monodevelop from source..