diff options
author | Sandy Armstrong <sandy@xamarin.com> | 2019-05-10 19:11:57 +0300 |
---|---|---|
committer | Sandy Armstrong <sandy@xamarin.com> | 2019-05-10 19:11:57 +0300 |
commit | e41315314ed4e191e37b626d2630dd4bf39b7b14 (patch) | |
tree | 3837e1b4360332f8934189d68a0a0a348e5fafa1 /main/src/addins/MonoDevelop.TextEditor | |
parent | 13d6e33c680a7217482a24cda40f4aee6cc24314 (diff) |
TextViewContent: Clean up CanHandleCommand
Only look for a find presenter when querying about find
commands.
Fixes: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/890051
Diffstat (limited to 'main/src/addins/MonoDevelop.TextEditor')
-rw-r--r-- | main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewContent.Commands.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewContent.Commands.cs b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewContent.Commands.cs index 17e4edcfbd..ef072769e4 100644 --- a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewContent.Commands.cs +++ b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewContent.Commands.cs @@ -190,9 +190,10 @@ namespace MonoDevelop.TextEditor bool CanHandleCommand (object commandId) { - var findPresenter = Imports.FindPresenterFactory?.TryGetFindPresenter (TextView); - if (findPresenter != null && findPresenter.IsFocused) - return commandsSupportedWhenFindPresenterIsFocused.Contains (commandId); + if (commandsSupportedWhenFindPresenterIsFocused.Contains (commandId)) { + var findPresenter = Imports.FindPresenterFactory?.TryGetFindPresenter (TextView); + return findPresenter != null && findPresenter.IsFocused; + } return true; } |