aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorjohnsonj <devnull@localhost>2015-09-04 13:07:49 +1000
committerjohnsonj <devnull@localhost>2015-09-04 13:07:49 +1000
commit3dc404cbf409efeb8eb3bdcd38d21e5a218454a3 (patch)
tree756930c1786c2b668ff707b7b7c71fc54539948b /src
parent37c8cba55c4b6ad5fcefec97175072d73bb58743 (diff)
downloadscintilla-mirror-3dc404cbf409efeb8eb3bdcd38d21e5a218454a3.tar.gz
Change FillVirtualSpace to ClearBeforeTentativeStart and delete selected text.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx13
-rw-r--r--src/Editor.h2
2 files changed, 12 insertions, 3 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 3efd279df..2c613090c 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1948,12 +1948,21 @@ void Editor::AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS) {
}
}
-void Editor::FillVirtualSpace() {
+void Editor::ClearBeforeTentativeStart() {
// Make positions for the first composition string.
- for (size_t r=0; r<sel.Count(); r++) {
+ for (size_t r = 0; r<sel.Count(); r++) {
if (!RangeContainsProtected(sel.Range(r).Start().Position(),
sel.Range(r).End().Position())) {
int positionInsert = sel.Range(r).Start().Position();
+ if (!sel.Range(r).Empty()) {
+ if (sel.Range(r).Length()) {
+ pdoc->DeleteChars(positionInsert, sel.Range(r).Length());
+ sel.Range(r).ClearVirtualSpace();
+ } else {
+ // Range is all virtual so collapse to start of virtual space
+ sel.Range(r).MinimizeVirtualSpace();
+ }
+ }
InsertSpace(positionInsert, sel.Range(r).caret.VirtualSpace());
sel.Range(r).ClearVirtualSpace();
}
diff --git a/src/Editor.h b/src/Editor.h
index fdc86f9f6..7b88cbab0 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -392,7 +392,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
int InsertSpace(int position, unsigned int spaces);
void AddChar(char ch);
virtual void AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS=false);
- void FillVirtualSpace();
+ void ClearBeforeTentativeStart();
void InsertPaste(const char *text, int len);
enum PasteShape { pasteStream=0, pasteRectangular = 1, pasteLine = 2 };
void InsertPasteShape(const char *text, int len, PasteShape shape);