aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2002-04-04 03:10:20 +0000
committernyamatongwe <devnull@localhost>2002-04-04 03:10:20 +0000
commit04d22e6fcd1366d84a5c79c955a82c1827482b08 (patch)
tree8678e789f1288dfed57efe6582924a9ddfb2a1d4 /src/Document.cxx
parent953bfad661d0372430b4d5c33e773782605841dd (diff)
downloadscintilla-mirror-04d22e6fcd1366d84a5c79c955a82c1827482b08.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);
}
}