diff options
-rw-r--r-- | gtk/ScintillaGTK.cxx | 5 | ||||
-rw-r--r-- | src/Editor.cxx | 7 | ||||
-rw-r--r-- | src/Editor.h | 1 | ||||
-rw-r--r-- | win32/ScintillaWin.cxx | 5 |
4 files changed, 10 insertions, 8 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index bc3d00952..d5d0622da 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -2405,10 +2405,7 @@ void ScintillaGTK::PreeditChangedThis() { } else { // No tentative undo means start of this composition so // fill in any virtual spaces. - bool tmpOverstrike = inOverstrike; - inOverstrike = false; // Not allowed to be deleted twice. - AddCharUTF("", 0); - inOverstrike = tmpOverstrike; + FillVirtualSpace(); } PreEditString utfval(im_context); diff --git a/src/Editor.cxx b/src/Editor.cxx index 64017c58d..b85055202 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1898,6 +1898,13 @@ 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; +} + void Editor::InsertPaste(const char *text, int len) { if (multiPasteMode == SC_MULTIPASTE_ONCE) { SelectionPosition selStart = sel.Start(); diff --git a/src/Editor.h b/src/Editor.h index 27a2469aa..ec24f66fd 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -388,6 +388,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 InsertPaste(const char *text, int len); enum PasteShape { pasteStream=0, pasteRectangular = 1, pasteLine = 2 }; void InsertPasteShape(const char *text, int len, PasteShape shape); diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 205d1d58e..35c106d5b 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -812,10 +812,7 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) { } else { // No tentative undo means start of this composition so // fill in any virtual spaces. - bool tmpOverstrike = inOverstrike; - inOverstrike = false; // not allow to be deleted twice. - AddCharUTF("", 0); - inOverstrike = tmpOverstrike; + FillVirtualSpace(); } view.imeCaretBlockOverride = false; |