diff options
author | Jeffrey Stedfast <jeff@xamarin.com> | 2012-01-06 03:25:00 +0400 |
---|---|---|
committer | Jeffrey Stedfast <jeff@xamarin.com> | 2012-01-06 03:35:26 +0400 |
commit | a9ef77e19063319d95613aabd7adc1fd9b192a67 (patch) | |
tree | 6e44daf963bfd89110b064f7011c73ce5ba75237 | |
parent | fd179d18f03dfa320df5468e8bd4baf7ea6fc648 (diff) |
[Ide & Debugger] Fixed OpenDocument optimization.
Turns out the Debugger's OpenDocument() logic didn't use OpenDocumentOptions.Default.
4 files changed, 9 insertions, 4 deletions
diff --git a/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs b/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs index b326607ac0..144014ac09 100644 --- a/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs +++ b/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs @@ -161,7 +161,7 @@ namespace MonoDevelop.ChangeLogAddIn return null; if (File.Exists (clog)) - return IdeApp.Workbench.OpenDocument (clog, OpenDocumentOptions.OnlyInternalViewer); + return IdeApp.Workbench.OpenDocument (clog, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer); Document document = IdeApp.Workbench.NewDocument (clog, "text/plain", ""); document.Save(); diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs index 863e6822b4..355cdb276a 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs @@ -767,7 +767,7 @@ namespace MonoDevelop.Debugger if (currentBacktrace != null) { var sf = GetCurrentVisibleFrame (); if (!string.IsNullOrEmpty (sf.SourceLocation.FileName) && System.IO.File.Exists (sf.SourceLocation.FileName) && sf.SourceLocation.Line != -1) { - Document document = IdeApp.Workbench.OpenDocument (sf.SourceLocation.FileName, sf.SourceLocation.Line, 1, OpenDocumentOptions.BringToFront); + Document document = IdeApp.Workbench.OpenDocument (sf.SourceLocation.FileName, sf.SourceLocation.Line, 1, OpenDocumentOptions.Debugger); OnDisableConditionalCompilation (new DocumentEventArgs (document)); } } diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Initializer.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Initializer.cs index 8a31d2bfa4..a3b6dd141c 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Initializer.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Initializer.cs @@ -79,7 +79,11 @@ namespace MonoDevelop.Debugger int line = frame.SourceLocation.Line; if (!file.IsNullOrEmpty && System.IO.File.Exists (file) && line != -1) { - OpenDocumentOptions ops = !disassemblyCurrent ? OpenDocumentOptions.BringToFront : OpenDocumentOptions.None; + OpenDocumentOptions ops = OpenDocumentOptions.Debugger; + + if (disassemblyCurrent) + ops &= ~OpenDocumentOptions.BringToFront; + Document doc = IdeApp.Workbench.OpenDocument (file, line, 1, ops); if (doc != null) return; 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 9b635a01df..d68293d7ce 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs @@ -1105,6 +1105,7 @@ namespace MonoDevelop.Ide.Gui OnlyExternalViewer = 1 << 4, TryToReuseViewer = 1 << 5, - Default = BringToFront | CenterCaretLine | HighlightCaretLine | TryToReuseViewer + Default = BringToFront | CenterCaretLine | HighlightCaretLine | TryToReuseViewer, + Debugger = BringToFront | CenterCaretLine | TryToReuseViewer } } |