Browse Source

Fixed small selection bug in snippet completion window (Ctrl+J).

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5548 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Daniel Grunwald 16 years ago
parent
commit
2af09d613b
  1. 14
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Snippets/CodeSnippetCompletionWindow.cs
  2. 4
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/CompletionWindowBase.cs

14
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Snippets/CodeSnippetCompletionWindow.cs

@ -19,7 +19,7 @@ using ICSharpCode.SharpDevelop.Editor.CodeCompletion; @@ -19,7 +19,7 @@ using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
namespace ICSharpCode.AvalonEdit.AddIn.Snippets
{
/// <summary>
/// Description of CodeSnippetCompletionWindow.
/// Completion window used for code snippets.
/// </summary>
public class CodeSnippetCompletionWindow : SharpDevelopCompletionWindow
{
@ -47,16 +47,20 @@ namespace ICSharpCode.AvalonEdit.AddIn.Snippets @@ -47,16 +47,20 @@ namespace ICSharpCode.AvalonEdit.AddIn.Snippets
this.Loaded += delegate { Keyboard.Focus(snippetInput); };
this.snippetInput.PreviewKeyDown += new KeyEventHandler(CodeSnippetCompletionWindowPreviewKeyDown);
this.snippetInput.TextChanged += new TextChangedEventHandler(CodeSnippetCompletionWindow_TextChanged);
}
void CodeSnippetCompletionWindowPreviewKeyDown(object sender, KeyEventArgs e)
{
CompletionList.HandleKey(e);
if (!e.Handled)
CompletionList.SelectItemWithStart(this.snippetInput.Text);
}
protected override void ActiveParentWindow()
void CodeSnippetCompletionWindow_TextChanged(object sender, TextChangedEventArgs e)
{
CompletionList.SelectItemWithStart(this.snippetInput.Text);
}
protected override void ActivateParentWindow()
{
}
}

4
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/CompletionWindowBase.cs

@ -202,13 +202,13 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion @@ -202,13 +202,13 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion
// Special handler: handledEventsToo
void OnMouseUp(object sender, MouseButtonEventArgs e)
{
ActiveParentWindow();
ActivateParentWindow();
}
/// <summary>
/// Activates the parent window.
/// </summary>
protected virtual void ActiveParentWindow()
protected virtual void ActivateParentWindow()
{
if (parentWindow != null)
parentWindow.Activate();

Loading…
Cancel
Save