aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authorjohnsonj <devnull@localhost>2015-08-24 09:15:39 +1000
committerjohnsonj <devnull@localhost>2015-08-24 09:15:39 +1000
commit0549d0c0bc2963caa78f11fce65833030a3cfacb (patch)
treeb336974c52fd4766147c069cf096fb8511309f42 /src/Editor.cxx
parent57b4b1c45650b2fe44f3b7a72e9a0771c29262e3 (diff)
downloadscintilla-mirror-0549d0c0bc2963caa78f11fce65833030a3cfacb.tar.gz
Simplify filling virtual space and avoid any side effects that may be caused by
calling AddCharUTF.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx13
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) {