Bug 14686 - Relative path strings containing backslashes have incorrect behavior when removing the @ symbol.
Summary: Relative path strings containing backslashes have incorrect behavior when rem...
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: Trunk
Hardware: PC Linux
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2013-09-12 13:14 UTC by Jason Ausborn
Modified: 2013-09-13 13:51 UTC (History)
1 user (show)

Tags:
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:
Status:
RESOLVED FIXED

Description Jason Ausborn 2013-09-12 13:14:36 UTC
Product: Compiled MD from the read-only git version today.

OS: Linux OpenSuse Factory (13.1)

-------------------

Steps to reproduce from user:


Create a relative string containing a backslash like shown below.

string test = @"\";

Delete the @ symbol, and the editor creates a double backslash as shown below.

string test = "\\";

Add the @ symbol again, and you should see the extra " below.

string test = @"\"";

-------------------------

Also, I was testing the same behavior as above while using double backslashes like below.

string test = @"test\\test\\test\\test\\";

Occasionally, the editor would get corrupted (not always), and I would receive various Failed Assertion errors. The corruption does not always occur, but when it does, I receive Failed Assertions in the console.

ERROR [2013-09-12 11:29:49Z]: Failed assertion: index must be >=0 but was -1.

ERROR [2013-09-12 11:29:44Z]: Failed assertion at Mono.TextEditor.HeightTree.GetSingleLineNode(Int32 lineNumber) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs:line 434


--------------------------


ERROR [2013-09-12 11:29:49Z]: Failed assertion: index must be >=0 but was -1.
Stack trace:   at System.Environment.get_StackTrace() in /home/abuild/rpmbuild/BUILD/mono-3.0.6/mcs/class/corlib/System/Environment.cs:line 261
   at Mono.TextEditor.LineSplitter.GetNode(Int32 index) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs:line 522
   at Mono.TextEditor.LineSplitter.Get(Int32 number) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs:line 87
   at Mono.TextEditor.LineSplitter.GetLineByOffset(Int32 offset) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs:line 92
   at Mono.TextEditor.TextDocument.GetLineByOffset(Int32 offset) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs:line 508
   at Mono.TextEditor.FoldSegment.get_EndLine() in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/FoldSegment.cs:line 82
   at Mono.TextEditor.FoldMarkerMargin.Draw(Cairo.Context cr, Rectangle area, Mono.TextEditor.DocumentLine lineSegment, Int32 line, Double x, Double y, Double lineHeight) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldMarkerMargin.cs:line 326
   at Mono.TextEditor.TextArea.RenderMargins(Cairo.Context cr, Cairo.Context textViewCr, Rectangle cairoRectangle) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs:line 1752
   at Mono.TextEditor.TextArea.OnExposeEvent(Gdk.EventExpose e) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs:line 1825
   at Gtk.Widget.exposeevent_cb(IntPtr widget, IntPtr evnt) in /home/abuild/rpmbuild/BUILD/gtk-sharp-2.12.10/gtk/generated/Widget.cs:line 1979
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run() in /home/abuild/rpmbuild/BUILD/gtk-sharp-2.12.10/gtk/Application.cs:line 135
   at MonoDevelop.Ide.IdeApp.Run() in /home/jason/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:line 387
   at MonoDevelop.Ide.IdeStartup.Run(MonoDevelop.Ide.MonoDevelopOptions options) in /home/jason/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 295
   at MonoDevelop.Ide.IdeStartup.Main(System.String[] args) in /home/jason/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 541
   at MonoDevelop.Startup.MonoDevelopMain.Main(System.String[] args) in /home/jason/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:line 17
   at Mono.TextEditor.LineSplitter.GetNode(Int32 index) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs:line 522
   at Mono.TextEditor.LineSplitter.Get(Int32 number) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs:line 87
   at Mono.TextEditor.LineSplitter.GetLineByOffset(Int32 offset) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs:line 92
   at Mono.TextEditor.TextDocument.GetLineByOffset(Int32 offset) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs:line 508
   at Mono.TextEditor.FoldSegment.get_EndLine() in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/FoldSegment.cs:line 82
   at Mono.TextEditor.FoldMarkerMargin.Draw(Cairo.Context cr, Rectangle area, Mono.TextEditor.DocumentLine lineSegment, Int32 line, Double x, Double y, Double lineHeight) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldMarkerMargin.cs:line 326
   at Mono.TextEditor.TextArea.RenderMargins(Cairo.Context cr, Cairo.Context textViewCr, Rectangle cairoRectangle) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs:line 1752
   at Mono.TextEditor.TextArea.OnExposeEvent(Gdk.EventExpose e) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs:line 1825
   at Gtk.Widget.exposeevent_cb(IntPtr widget, IntPtr evnt) in /home/abuild/rpmbuild/BUILD/gtk-sharp-2.12.10/gtk/generated/Widget.cs:line 1979
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run() in /home/abuild/rpmbuild/BUILD/gtk-sharp-2.12.10/gtk/Application.cs:line 135
   at MonoDevelop.Ide.IdeApp.Run() in /home/jason/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:line 387
   at MonoDevelop.Ide.IdeStartup.Run(MonoDevelop.Ide.MonoDevelopOptions options) in /home/jason/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 295
   at MonoDevelop.Ide.IdeStartup.Main(System.String[] args) in /home/jason/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 541
   at MonoDevelop.Startup.MonoDevelopMain.Main(System.String[] args) in /home/jason/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:line 17


--------------------------------


ERROR [2013-09-12 11:29:44Z]: Failed assertion at Mono.TextEditor.HeightTree.GetSingleLineNode(Int32 lineNumber) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs:line 434
   at Mono.TextEditor.HeightTree.LineNumberToY(Int32 lineNumber) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs:line 293
   at Mono.TextEditor.TextViewMargin.LineToY(Int32 logicalLine) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs:line 3095
   at Mono.TextEditor.TextArea.LineToY(Int32 logicalLine) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs:line 2883
   at Mono.TextEditor.TextArea.RedrawFromLine(Int32 logicalLine) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs:line 905
   at Mono.TextEditor.TextArea.<Initialize>m__7E(System.Object sender, Mono.TextEditor.HeightChangedEventArgs e) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs:line 374
   at Mono.TextEditor.HeightTree.OnLineUpdateFrom(Mono.TextEditor.HeightChangedEventArgs e) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs:line 116
   at Mono.TextEditor.HeightTree.RemoveLine(Int32 line) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs:line 103
   at Mono.TextEditor.HeightTree.HandleLineRemoved(System.Object sender, Mono.TextEditor.LineEventArgs e) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs:line 73
   at Mono.TextEditor.LineSplitter.OnLineRemoved(Mono.TextEditor.LineEventArgs e) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs:line 466
   at Mono.TextEditor.LineSplitter.RemoveLine(Mono.TextEditor.TreeNode line, Int32 lineNumber) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs:line 515
   at Mono.TextEditor.LineSplitter.TextRemove(Int32 offset, Int32 length) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs:line 129
   at Mono.TextEditor.LineSplitter.TextReplaced(System.Object sender, Mono.TextEditor.DocumentChangeEventArgs args) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs:line 98
   at Mono.TextEditor.TextDocument.Replace(Int32 offset, Int32 count, System.String value, AnchorMovementType anchorMovementType) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs:line 251
   at Mono.TextEditor.TextDocument.Replace(Int32 offset, Int32 count, System.String value) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs:line 219
   at Mono.TextEditor.TextEditorData.Replace(Int32 offset, Int32 count, System.String value) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs:line 440
   at MonoDevelop.CSharp.Formatting.CSharpTextEditorIndentation.ConvertNormalToVerbatimString(Mono.TextEditor.TextEditorData textEditorData, Int32 offset) in /home/jason/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:line 289
   at MonoDevelop.CSharp.Formatting.CSharpTextEditorIndentation.KeyPress(Key key, Char keyChar, ModifierType modifier) in /home/jason/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:line 446
   at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress(Key key, Char keyChar, ModifierType modifier) in /home/jason/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:line 109
   at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress(Key key, Char keyChar, ModifierType modifier) in /home/jason/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:line 109
   at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress(Key key, Char keyChar, ModifierType modifier) in /home/jason/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:line 109
   at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress(Key key, Char keyChar, ModifierType modifier) in /home/jason/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:line 109
   at MonoDevelop.Debugger.ExceptionCaughtTextEditorExtension.KeyPress(Key key, Char keyChar, ModifierType modifier) in /home/jason/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs:line 441
   at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress(Key key, Char keyChar, ModifierType modifier) in /home/jason/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:line 109
   at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress(Key key, Char keyChar, ModifierType modifier) in /home/jason/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:line 109
   at MonoDevelop.SourceEditor.ExtensibleTextEditor.ExtensionKeyPress(Key key, UInt32 ch, ModifierType state) in /home/jason/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:line 241
   at MonoDevelop.SourceEditor.ExtensibleTextEditor.OnIMProcessedKeyPressEvent(Key key, UInt32 ch, ModifierType state) in /home/jason/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:line 401
   at Mono.TextEditor.TextArea.IMCommit(System.Object sender, Gtk.CommitArgs ca) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs:line 597
   at System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod , System.Object , System.Object[] , System.Exception ByRef )
   at System.Reflection.MonoMethod.Invoke(System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) in /home/abuild/rpmbuild/BUILD/mono-3.0.6/mcs/class/corlib/System.Reflection/MonoMethod.cs:line 231
   at System.Reflection.MethodBase.Invoke(System.Object obj, System.Object[] parameters) in /home/abuild/rpmbuild/BUILD/mono-3.0.6/mcs/class/corlib/System.Reflection/MethodBase.cs:line 101
   at System.Delegate.DynamicInvokeImpl(System.Object[] args) in /home/abuild/rpmbuild/BUILD/mono-3.0.6/mcs/class/corlib/System/Delegate.cs:line 424
   at System.MulticastDelegate.DynamicInvokeImpl(System.Object[] args) in /home/abuild/rpmbuild/BUILD/mono-3.0.6/mcs/class/corlib/System/MulticastDelegate.cs:line 72
   at System.Delegate.DynamicInvoke(System.Object[] args) in /home/abuild/rpmbuild/BUILD/mono-3.0.6/mcs/class/corlib/System/Delegate.cs:line 398
   at GLib.Signal.ClosureInvokedCB(System.Object o, GLib.ClosureInvokedArgs args) in /home/abuild/rpmbuild/BUILD/gtk-sharp-2.12.10/glib/Signal.cs:line 195
   at GLib.SignalClosure.Invoke(GLib.ClosureInvokedArgs args) in /home/abuild/rpmbuild/BUILD/gtk-sharp-2.12.10/glib/SignalClosure.cs:line 118
   at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) in /home/abuild/rpmbuild/BUILD/gtk-sharp-2.12.10/glib/SignalClosure.cs:line 159
   at Gtk.IMContext.gtk_im_context_filter_keypress(IntPtr , IntPtr )
   at Gtk.IMContext.FilterKeypress(Gdk.EventKey evnt) in /home/abuild/rpmbuild/BUILD/gtk-sharp-2.12.10/gtk/generated/IMContext.cs:line 369
   at Mono.TextEditor.TextArea.IMFilterKeyPress(Gdk.EventKey evt, Key mappedKey, UInt32 mappedChar, ModifierType mappedModifiers) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs:line 935
   at Mono.TextEditor.TextArea.OnKeyPressEvent(Gdk.EventKey evt) in /home/jason/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs:line 986
   at Gtk.Widget.keypressevent_cb(IntPtr widget, IntPtr evnt) in /home/abuild/rpmbuild/BUILD/gtk-sharp-2.12.10/gtk/generated/Widget.cs:line 2555
   at Gtk.Widget.gtksharp_widget_base_key_press_event(IntPtr , IntPtr )
   at Gtk.Widget.OnKeyPressEvent(Gdk.EventKey evnt) in /home/abuild/rpmbuild/BUILD/gtk-sharp-2.12.10/gtk/generated/Widget.cs:line 2576
   at MonoDevelop.Ide.Gui.DefaultWorkbench.OnKeyPressEvent(Gdk.EventKey evnt) in /home/jason/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs:line 1108
   at Gtk.Widget.keypressevent_cb(IntPtr widget, IntPtr evnt) in /home/abuild/rpmbuild/BUILD/gtk-sharp-2.12.10/gtk/generated/Widget.cs:line 2555
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run() in /home/abuild/rpmbuild/BUILD/gtk-sharp-2.12.10/gtk/Application.cs:line 135
   at MonoDevelop.Ide.IdeApp.Run() in /home/jason/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:line 387
   at MonoDevelop.Ide.IdeStartup.Run(MonoDevelop.Ide.MonoDevelopOptions options) in /home/jason/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 295
   at MonoDevelop.Ide.IdeStartup.Main(System.String[] args) in /home/jason/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 541
   at MonoDevelop.Startup.MonoDevelopMain.Main(System.String[] args) in /home/jason/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:line 17
Comment 1 Mike Krüger 2013-09-12 14:02:07 UTC
should be fixed
Comment 2 Jason Ausborn 2013-09-12 14:54:03 UTC
Thanks Mike! I will test another git grab shortly.
Comment 3 Jason Ausborn 2013-09-13 13:43:47 UTC
Fix is confirmed.
Comment 4 Mike Krüger 2013-09-13 13:51:51 UTC
Good to know - thanks for reporting back :)