aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/Editor.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 82675d3a2..d81e5aa00 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -3243,9 +3243,12 @@ void Editor::AddChar(char ch) {
void Editor::AddCharUTF(char *s, unsigned int len, bool treatAsDBCS) {
bool wasSelection = currentPos != anchor;
ClearSelection();
+ bool charReplaceAction = false;
if (inOverstrike && !wasSelection && !RangeContainsProtected(currentPos, currentPos + 1)) {
if (currentPos < (pdoc->Length())) {
if (!IsEOLChar(pdoc->CharAt(currentPos))) {
+ charReplaceAction = true;
+ pdoc->BeginUndoAction();
pdoc->DelChar(currentPos);
}
}
@@ -3253,6 +3256,9 @@ void Editor::AddCharUTF(char *s, unsigned int len, bool treatAsDBCS) {
if (pdoc->InsertString(currentPos, s, len)) {
SetEmptySelection(currentPos + len);
}
+ if (charReplaceAction) {
+ pdoc->EndUndoAction();
+ }
EnsureCaretVisible();
// Avoid blinking during rapid typing:
ShowCaretAtCurrentPosition();