diff options
author | Aaron Bockover <abock@microsoft.com> | 2019-05-22 03:31:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-22 03:31:51 +0300 |
commit | 209af53c6490749b7147bdc5c302a76b2d358a94 (patch) | |
tree | ddc52a695331ef755c843f3a27a6570bc627333e /main/src/addins/MonoDevelop.TextEditor | |
parent | d750f137eb6ba2f1a97521a69dc33ffcc2bc44ae (diff) | |
parent | d64c637c6f8483125bdbaa041fcfbcba536c785b (diff) |
Merge pull request #7615 from mono/backport-pr-7610-to-master
[master] Fix Find commands availability.
Diffstat (limited to 'main/src/addins/MonoDevelop.TextEditor')
-rw-r--r-- | main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewContent.Commands.cs | 9 |
1 files changed, 6 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 ef072769e4..9862eccb1c 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,12 @@ namespace MonoDevelop.TextEditor bool CanHandleCommand (object commandId) { - if (commandsSupportedWhenFindPresenterIsFocused.Contains (commandId)) { - var findPresenter = Imports.FindPresenterFactory?.TryGetFindPresenter (TextView); - return findPresenter != null && findPresenter.IsFocused; + // check TextView for null because of https://devdiv.visualstudio.com/DevDiv/_workitems/edit/890051 + if (TextView is ITextView textView) { + var findPresenter = Imports.FindPresenterFactory?.TryGetFindPresenter (textView); + if (findPresenter != null && findPresenter.IsFocused) { + return commandsSupportedWhenFindPresenterIsFocused.Contains (commandId); + } } return true; |