From 101f977f023a127954553ebf184b10d39520641e Mon Sep 17 00:00:00 2001 From: graphemecluster Date: Fri, 10 May 2024 18:08:30 +0800 Subject: [PATCH] Hide Caret in Schema Menu --- src/rime/context.cc | 4 +++- src/rime/switcher.cc | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rime/context.cc b/src/rime/context.cc index 34ca645231..68edd4e1e2 100644 --- a/src/rime/context.cc +++ b/src/rime/context.cc @@ -37,7 +37,9 @@ string Context::GetScriptText() const { static const string kCaretSymbol("\xe2\x80\xb8"); // U+2038 ‸ CARET string Context::GetSoftCursor() const { - return get_option("soft_cursor") ? kCaretSymbol : string(); + return get_option("soft_cursor") && !composition_.back().HasTag("switcher") + ? kCaretSymbol + : string(); } Preedit Context::GetPreedit() const { diff --git a/src/rime/switcher.cc b/src/rime/switcher.cc index 4abb3f4d6a..1459c76ef2 100644 --- a/src/rime/switcher.cc +++ b/src/rime/switcher.cc @@ -229,6 +229,7 @@ void Switcher::RefreshMenu() { // context_->set_input(" "); Segment seg(0, 0); // empty range seg.prompt = caption_; + seg.tags.insert("switcher"); comp.AddSegment(seg); } auto menu = New();