|
|
|
@ -7,6 +7,7 @@ using System.Collections.ObjectModel;
@@ -7,6 +7,7 @@ using System.Collections.ObjectModel;
|
|
|
|
|
using System.Collections.Specialized; |
|
|
|
|
using System.Linq; |
|
|
|
|
using System.Threading; |
|
|
|
|
using System.Windows; |
|
|
|
|
using System.Windows.Input; |
|
|
|
|
using System.Windows.Threading; |
|
|
|
|
|
|
|
|
@ -120,6 +121,13 @@ namespace ICSharpCode.AvalonEdit.AddIn.ContextActions
@@ -120,6 +121,13 @@ namespace ICSharpCode.AvalonEdit.AddIn.ContextActions
|
|
|
|
|
return; |
|
|
|
|
ClosePopup(); |
|
|
|
|
|
|
|
|
|
// Don't show the context action popup when the caret is outside the editor boundaries
|
|
|
|
|
var textView = this.editorView.TextArea.TextView; |
|
|
|
|
Rect editorRect = new Rect((Point)textView.ScrollOffset, textView.RenderSize); |
|
|
|
|
Rect caretRect = this.editorView.TextArea.Caret.CalculateCaretRectangle(); |
|
|
|
|
if (!editorRect.Contains(caretRect)) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
ContextActionsBulbViewModel popupVM = BuildPopupViewModel(); |
|
|
|
|
this.cancellationTokenSourceForPopupBeingOpened = new CancellationTokenSource(); |
|
|
|
|
var cancellationToken = cancellationTokenSourceForPopupBeingOpened.Token; |
|
|
|
|