aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2005-07-18 00:50:46 +0000
committernyamatongwe <unknown>2005-07-18 00:50:46 +0000
commita465db59fb83fe6fe20d18b69a23d3e7e44432a9 (patch)
treec6747c9685aed8374d7760c57110325d2964a529
parent4954f7e046ab70eb9994cd6b763e3097ee7687de (diff)
downloadscintilla-mirror-a465db59fb83fe6fe20d18b69a23d3e7e44432a9.tar.gz
Fix for bug #1239832 where typing in overstrike mode was undone in two
steps rather than one.
-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();