Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLluis Sanchez <lluis@xamarin.com>2014-09-18 16:32:03 +0400
committerLluis Sanchez <lluis@xamarin.com>2014-09-18 16:32:46 +0400
commit7495942eb76d6b80c460ddd61f2b94cba1a97fa2 (patch)
tree9da9c822286e2914c63ca715a4d552e6b203999b
parent0382ab98c42e4491facee03f247802f0e10b3b55 (diff)
[Ide] Fix some issues in the document notebookmonodevelop-5.5.0.198
Make sure a valid tab is selected if the current tab is closed. This fixes bug 23120 - On switching back to one editor column exception 'System.NullReferenceException:' appears Also fixes bug 22278 - Closing tabs with Apple+W leads to lost focus/blank editor.
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs12
1 files changed, 7 insertions, 5 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
index 0d4d2a947f..9cc941f9d5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
@@ -221,10 +221,10 @@ namespace MonoDevelop.Components.DockNotebook
if (pagesHistory.Count > 0)
CurrentTab = pagesHistory [0];
else {
- if (lastClosed < pages.Count)
- CurrentTab = pages [lastClosed];
+ if (lastClosed + 1 < pages.Count)
+ CurrentTab = pages [lastClosed + 1];
else
- CurrentTab = pages [pages.Count - 1];
+ CurrentTab = pages [lastClosed - 1];
}
}
@@ -344,8 +344,10 @@ namespace MonoDevelop.Components.DockNotebook
if (animate)
tabStrip.StartCloseAnimation ((DockNotebookTab)tab);
pagesHistory.Remove (tab);
- if (page == CurrentTabIndex)
- SelectLastActiveTab (page + 1);
+ if (pages.Count == 1)
+ CurrentTab = null;
+ else if (page == CurrentTabIndex)
+ SelectLastActiveTab (page);
pages.RemoveAt (page);
UpdateIndexes (page);
tabStrip.Update ();