From 4c672afce9faa4a501558d31ae6cc9abedbfd185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Mon, 26 Aug 2013 16:43:39 +0200 Subject: [SourceEditor] Added bounds check to the quick task panel. --- .../QuickTaskOverviewMode.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'main/src') diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs index ebfe307f0b..f1f4b87df8 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs @@ -351,8 +351,14 @@ namespace MonoDevelop.SourceEditor.QuickTasks if (hoverOverIndicator) { parentStrip.GotoTask (parentStrip.SearchNextTask (currentHoverMode)); return base.OnButtonPressEvent (evnt); - } else if (hoverTask != null) { - TextEditor.Caret.Location = new DocumentLocation (hoverTask.Location.Line, Math.Max (DocumentLocation.MinColumn, hoverTask.Location.Column)); + } + + if (hoverTask != null) { + if (hoverTask.Location.IsEmpty) { + Console.WriteLine ("empty:"+ hoverTask.Description); + } + var loc = new DocumentLocation (Math.Max (DocumentLocation.MinLine, hoverTask.Location.Line), Math.Max (DocumentLocation.MinColumn, hoverTask.Location.Column)); + TextEditor.Caret.Location = loc; TextEditor.CenterToCaret (); TextEditor.StartCaretPulseAnimation (); TextEditor.GrabFocus (); -- cgit v1.2.3