diff options
author | Mike Krüger <mkrueger@novell.com> | 2010-04-29 12:32:44 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@novell.com> | 2010-04-29 12:32:44 +0400 |
commit | 271810640d857ad0eaa4a9a20619e184693fcd6a (patch) | |
tree | 474f1e3c52773a795a7c6b35be0315270a506f22 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui | |
parent | ae0bcb07aa5c37a050f348e3d89a1783214fcac5 (diff) |
* MonoDevelop.Ide.Gui/Workbench.cs:
* MonoDevelop.Ide.Gui/DocumentNavigationPoint.cs:
* MonoDevelop.Ide.Gui/NavigationHistoryService.cs: found better fix
for 'Bug 600657 - "Show Previous Warning/Error" fails when there are
warnings without file offsets'.
svn path=/trunk/monodevelop/; revision=156401
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui')
3 files changed, 32 insertions, 7 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentNavigationPoint.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentNavigationPoint.cs index 319943d4e4..e0dc72dd08 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentNavigationPoint.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentNavigationPoint.cs @@ -64,10 +64,11 @@ namespace MonoDevelop.Ide.Gui get { return doc != null? doc.FileName : fileName; } } - public override void Show () + public override bool Show () { if (!string.IsNullOrEmpty (fileName)) - DoShow (); + return DoShow () != null; + return false; } protected virtual Document DoShow () diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/NavigationHistoryService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/NavigationHistoryService.cs index dfcb08d3ae..e1d0c8a5e4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/NavigationHistoryService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/NavigationHistoryService.cs @@ -374,7 +374,7 @@ namespace MonoDevelop.Ide.Gui public abstract string DisplayName { get; } public abstract string Tooltip { get; } - public abstract void Show (); + public abstract bool Show (); // used for fuzzy matching to decide whether to replace an existing nav point // e.g if user just moves around a little, we don't want to add too many points diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs index aa09aea56e..6ee434b1ba 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs @@ -557,8 +557,20 @@ namespace MonoDevelop.Ide.Gui if (activeLocationList != null) { NavigationPoint next = activeLocationList.GetNextLocation (); - if (next != null) - next.Show (); + if (next != null) { + bool result = next.Show (); + if (!result) { + HashSet<NavigationPoint> visited = new HashSet<NavigationPoint> (); + visited.Add (next); + while (!result) { + next = activeLocationList.GetNextLocation (); + if (visited.Contains (next)) + break; + visited.Add (next); + result = next.Show (); + } + } + } } } @@ -568,8 +580,20 @@ namespace MonoDevelop.Ide.Gui if (activeLocationList != null) { NavigationPoint next = activeLocationList.GetPreviousLocation (); - if (next != null) - next.Show (); + if (next != null) { + bool result = next.Show (); + if (!result) { + HashSet<NavigationPoint> visited = new HashSet<NavigationPoint> (); + visited.Add (next); + while (!result) { + next = activeLocationList.GetPreviousLocation (); + if (visited.Contains (next)) + break; + visited.Add (next); + result = next.Show (); + } + } + } } } |