diff options
author | johnsonj <devnull@localhost> | 2015-08-24 09:15:39 +1000 |
---|---|---|
committer | johnsonj <devnull@localhost> | 2015-08-24 09:15:39 +1000 |
commit | 0549d0c0bc2963caa78f11fce65833030a3cfacb (patch) | |
tree | b336974c52fd4766147c069cf096fb8511309f42 | |
parent | 57b4b1c45650b2fe44f3b7a72e9a0771c29262e3 (diff) | |
download | scintilla-mirror-0549d0c0bc2963caa78f11fce65833030a3cfacb.tar.gz |
Simplify filling virtual space and avoid any side effects that may be caused by
calling AddCharUTF.
-rw-r--r-- | src/Editor.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index ca87b1319..3efd279df 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1949,10 +1949,15 @@ void Editor::AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS) { } void Editor::FillVirtualSpace() { - const bool tmpOverstrike = inOverstrike; - inOverstrike = false; // not allow to be deleted twice. - AddCharUTF("", 0); - inOverstrike = tmpOverstrike; + // Make positions for the first composition string. + 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(); + InsertSpace(positionInsert, sel.Range(r).caret.VirtualSpace()); + sel.Range(r).ClearVirtualSpace(); + } + } } void Editor::InsertPaste(const char *text, int len) { |