From 521eab3c0d76888cca009ce85b7554731cf5ba1f Mon Sep 17 00:00:00 2001 From: johnsonj Date: Fri, 4 Sep 2015 13:07:49 +1000 Subject: Change FillVirtualSpace to ClearBeforeTentativeStart and delete selected text. --- src/Editor.cxx | 13 +++++++++++-- src/Editor.h | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src') 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; rDeleteChars(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); -- cgit v1.2.3