|
|
@ -866,8 +866,11 @@ namespace ICSharpCode.AvalonEdit.Editing |
|
|
|
if (!e.Handled) { |
|
|
|
if (!e.Handled) { |
|
|
|
if (e.Text == "\n" || e.Text == "\r" || e.Text == "\r\n") |
|
|
|
if (e.Text == "\n" || e.Text == "\r" || e.Text == "\r\n") |
|
|
|
ReplaceSelectionWithNewLine(); |
|
|
|
ReplaceSelectionWithNewLine(); |
|
|
|
else |
|
|
|
else { |
|
|
|
|
|
|
|
if (overstrikeMode && Selection.IsEmpty && Document.GetLineByNumber(Caret.Line).EndOffset > Caret.Offset) |
|
|
|
|
|
|
|
Selection = Selection.Create(this, Caret.Offset, Caret.Offset+e.Text.Length); |
|
|
|
ReplaceSelectionWithText(e.Text); |
|
|
|
ReplaceSelectionWithText(e.Text); |
|
|
|
|
|
|
|
} |
|
|
|
OnTextEntered(e); |
|
|
|
OnTextEntered(e); |
|
|
|
caret.BringCaretToView(); |
|
|
|
caret.BringCaretToView(); |
|
|
|
} |
|
|
|
} |
|
|
@ -952,6 +955,15 @@ namespace ICSharpCode.AvalonEdit.Editing |
|
|
|
protected override void OnPreviewKeyDown(KeyEventArgs e) |
|
|
|
protected override void OnPreviewKeyDown(KeyEventArgs e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
base.OnPreviewKeyDown(e); |
|
|
|
base.OnPreviewKeyDown(e); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!this.Options.UseOverstrikeMode) { |
|
|
|
|
|
|
|
this.overstrikeMode = false; |
|
|
|
|
|
|
|
} else if (!e.Handled && e.Key == Key.Insert) { |
|
|
|
|
|
|
|
this.overstrikeMode = !this.overstrikeMode; |
|
|
|
|
|
|
|
e.Handled = true; |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
HideMouseCursor(); |
|
|
|
HideMouseCursor(); |
|
|
|
foreach (TextAreaStackedInputHandler h in stackedInputHandlers) { |
|
|
|
foreach (TextAreaStackedInputHandler h in stackedInputHandlers) { |
|
|
|
if (e.Handled) |
|
|
|
if (e.Handled) |
|
|
@ -1017,6 +1029,12 @@ namespace ICSharpCode.AvalonEdit.Editing |
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region Overstrike mode
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool overstrikeMode = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
protected override HitTestResult HitTestCore(PointHitTestParameters hitTestParameters) |
|
|
|
protected override HitTestResult HitTestCore(PointHitTestParameters hitTestParameters) |
|
|
|
{ |
|
|
|
{ |
|
|
|