diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 13 | ||||
-rw-r--r-- | src/Editor.h | 2 |
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); |