Browse Source

Fixed SD2-695. Unsetting a breakpoint when viewing an xml document no longer leaves red text behind.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1169 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 20 years ago
parent
commit
91dec8424b
  1. 21
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlEditorControl.cs

21
src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlEditorControl.cs

@ -7,6 +7,7 @@
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Bookmarks;
using ICSharpCode.SharpDevelop.DefaultEditor; using ICSharpCode.SharpDevelop.DefaultEditor;
using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Gui;
@ -41,6 +42,8 @@ namespace ICSharpCode.XmlEditor
Document.FoldingManager.FoldingStrategy = new XmlFoldingStrategy(); Document.FoldingManager.FoldingStrategy = new XmlFoldingStrategy();
TextEditorProperties = new SharpDevelopTextEditorProperties(); TextEditorProperties = new SharpDevelopTextEditorProperties();
Document.BookmarkManager.Removed += new ICSharpCode.TextEditor.Document.BookmarkEventHandler(BookmarkRemoved);
GenerateEditActions(); GenerateEditActions();
} }
@ -324,5 +327,23 @@ namespace ICSharpCode.XmlEditor
ActiveTextAreaControl.TextArea.MotherTextEditorControl.EndUpdate(); ActiveTextAreaControl.TextArea.MotherTextEditorControl.EndUpdate();
} }
/// <summary>
/// Have to remove the bookmark from the document otherwise the text will
/// stay marked in red if the bookmark is a breakpoint. This is because
/// there are two bookmark managers, one in SharpDevelop itself and one
/// in the TextEditor library. By default, only the one in the text editor's
/// bookmark manager will be removed, so SharpDevelop will not know about it.
/// Removing it from the SharpDevelop BookMarkManager informs the debugger
/// service that the breakpoint has been removed so it triggers the removal
/// of the text marker.
/// </summary>
void BookmarkRemoved(object sender, ICSharpCode.TextEditor.Document.BookmarkEventArgs e)
{
ICSharpCode.SharpDevelop.Bookmarks.SDBookmark b = e.Bookmark as ICSharpCode.SharpDevelop.Bookmarks.SDBookmark;
if (b != null) {
ICSharpCode.SharpDevelop.Bookmarks.BookmarkManager.RemoveMark(b);
}
}
} }
} }

Loading…
Cancel
Save