diff --git a/src/rime/composition.cc b/src/rime/composition.cc index d23436502..3c009c3cd 100644 --- a/src/rime/composition.cc +++ b/src/rime/composition.cc @@ -24,9 +24,6 @@ bool Composition::HasFinishedComposition() const { Preedit Composition::GetPreedit(const string& full_input, size_t caret_pos, const string& caret) const { Preedit preedit; - if (empty()) { - return preedit; - } preedit.caret_pos = string::npos; size_t start = 0; size_t end = 0; diff --git a/src/rime/context.cc b/src/rime/context.cc index 4d69bd122..b8e64b574 100644 --- a/src/rime/context.cc +++ b/src/rime/context.cc @@ -32,7 +32,7 @@ string Context::GetScriptText() const { return composition_.GetScriptText(); } -static const string kCaretSymbol("\xe2\x80\xb8"); +static const string kCaretSymbol("\xe2\x80\xb8"); // U+2038 ‸ CARET string Context::GetSoftCursor() const { return get_option("soft_cursor") ? kCaretSymbol : string(); @@ -43,7 +43,7 @@ Preedit Context::GetPreedit() const { } bool Context::IsComposing() const { - return !input_.empty(); + return !input_.empty() || !composition_.empty(); } bool Context::HasMenu() const { diff --git a/src/rime/switcher.cc b/src/rime/switcher.cc index 088fe8770..6659ed33b 100644 --- a/src/rime/switcher.cc +++ b/src/rime/switcher.cc @@ -114,17 +114,17 @@ void Switcher::HighlightNextSchema() { ```yaml schema_list: - case: [mode/wubi, mode/wubi_pinyin] - schema: wubi_pinyin + schema: wubi_pinyin - case: [mode/wubi] - schema: wubi86 - - case: [mode/default] - schema: pinyin + schema: wubi86 + - case: [mode/default] + schema: pinyin - mode: - wubi: false - wubi_pinyin: false - default: true - ``` + mode: + wubi: false + wubi_pinyin: false + default: true + ``` */ static an ParseSchemaListEntry(Config* config, @@ -224,7 +224,8 @@ void Switcher::OnSelect(Context* ctx) { void Switcher::RefreshMenu() { Composition& comp = context_->composition(); if (comp.empty()) { - context_->set_input(" "); // make context_->IsComposing() == true + // no longer need this to make context_->IsComposing() == true + // context_->set_input(" "); Segment seg(0, 0); // empty range seg.prompt = caption_; comp.AddSegment(seg);