Browse Source

When the code-completion window is opened with Ctrl+Space/"complete when typing", deleting the completed text with backspace closes the code-completion window.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3244 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 17 years ago
parent
commit
d2b66aed54
  1. 10
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/CodeCompletionWindow.cs

10
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/CodeCompletionWindow.cs

@ -42,6 +42,7 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow @@ -42,6 +42,7 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow
return null;
}
CodeCompletionWindow codeCompletionWindow = new CodeCompletionWindow(completionDataProvider, completionData, parent, control, showDeclarationWindow, fixedListViewWidth);
codeCompletionWindow.CloseWhenCaretAtBeginning = firstChar == '\0';
codeCompletionWindow.ShowCompletionWindow();
return codeCompletionWindow;
}
@ -205,10 +206,19 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow @@ -205,10 +206,19 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow
}
}
/// <summary>
/// When this flag is set, code completion closes if the caret moves to the
/// beginning of the allowed range. This is useful in Ctrl+Space and "complete when typing",
/// but not in dot-completion.
/// </summary>
public bool CloseWhenCaretAtBeginning { get; set; }
protected override void CaretOffsetChanged(object sender, EventArgs e)
{
int offset = control.ActiveTextAreaControl.Caret.Offset;
if (offset == startOffset) {
if (CloseWhenCaretAtBeginning)
Close();
return;
}
if (offset < startOffset || offset > endOffset) {

Loading…
Cancel
Save