aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorjohnsonj <unknown>2015-08-24 09:15:39 +1000
committerjohnsonj <unknown>2015-08-24 09:15:39 +1000
commita979be54a54851771b94d6943d1dd88073ef1646 (patch)
tree7ed7ab32b2152eb312d7c9f11581391312fe22e0 /src
parent8ab71827471f5d9cdf5848bed5030fd39a3eac52 (diff)
downloadscintilla-mirror-a979be54a54851771b94d6943d1dd88073ef1646.tar.gz
Simplify filling virtual space and avoid any side effects that may be caused by
calling AddCharUTF.
Diffstat (limited to 'src')
-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) {