aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2002-04-04 03:10:20 +0000
committernyamatongwe <unknown>2002-04-04 03:10:20 +0000
commita3e1c4d6f23dabf63c029a2ea31869e17be215fb (patch)
tree8678e789f1288dfed57efe6582924a9ddfb2a1d4 /src/Document.cxx
parent00bf13a155d265805ccbcb805502ff6408c7f538 (diff)
downloadscintilla-mirror-a3e1c4d6f23dabf63c029a2ea31869e17be215fb.tar.gz
Improved caret movement in read-only mode by handling more cases where text is inserted and be removing handling of cases where text is deleted as these are handled automatically in the modification listener.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r--src/Document.cxx20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index 4272dda63..def80c49c 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -535,26 +535,18 @@ void Document::DelChar(int pos) {
DeleteChars(pos, LenChar(pos));
}
-int Document::DelCharBackMove(int pos, int len) {
- if (DeleteChars(pos - len, len)) {
- return pos - len;
- } else {
- return pos;
- }
-}
-
-int Document::DelCharBack(int pos) {
+void Document::DelCharBack(int pos) {
if (pos <= 0) {
- return pos;
+ return;
} else if (IsCrLf(pos - 2)) {
- return DelCharBackMove(pos, 2);
+ DeleteChars(pos - 2, 2);
} else if (SC_CP_UTF8 == dbcsCodePage) {
int startChar = MovePositionOutsideChar(pos - 1, -1, false);
- return DelCharBackMove(pos, pos - startChar);
+ DeleteChars(startChar, pos - startChar);
} else if (IsDBCS(pos - 1)) {
- return DelCharBackMove(pos, 2);
+ DeleteChars(pos - 2, 2);
} else {
- return DelCharBackMove(pos, 1);
+ DeleteChars(pos - 1, 1);
}
}