diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SharpDevelopCompletionWindow.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SharpDevelopCompletionWindow.cs index 93b076f6db..8af6abdee0 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SharpDevelopCompletionWindow.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SharpDevelopCompletionWindow.cs @@ -123,6 +123,9 @@ namespace ICSharpCode.AvalonEdit.AddIn case CompletionItemListKeyResult.InsertionKey: this.CompletionList.RequestInsertion(e); return; + case CompletionItemListKeyResult.Cancel: + Close(); + return; } } } diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlCodeCompletionBinding.cs b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlCodeCompletionBinding.cs index 168b49ad08..d229e99e83 100644 --- a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlCodeCompletionBinding.cs +++ b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlCodeCompletionBinding.cs @@ -27,7 +27,7 @@ namespace ICSharpCode.XmlEditor this.schemas = schemaFileAssociations.Schemas; } - char[] ignoredChars = new[] { '\\', '/', '"', '\'', '=', '>' }; + char[] ignoredChars = new[] { '\\', '/', '"', '\'', '=', '>', '!', '?' }; public CodeCompletionKeyPressResult HandleKeyPress(ITextEditor editor, char ch) { @@ -70,6 +70,14 @@ namespace ICSharpCode.XmlEditor public bool CtrlSpace(ITextEditor editor) { + int elementStartIndex = XmlParser.GetActiveElementStartIndex(editor.Document.Text, editor.Caret.Offset); + if (elementStartIndex <= -1) + return false; + if (editor.Document.GetText(elementStartIndex, editor.Document.TextLength >= elementStartIndex + "= elementStartIndex + " - BeforeStartKey + BeforeStartKey, + /// + /// This key triggers cancellation of completion. The completion window will be closed. + /// + Cancel } public class DefaultCompletionItemList : ICompletionItemList