From 206efd692124339d0e256198360c1860c72cd807 Mon Sep 17 00:00:00 2001 From: nameoverflow Date: Sun, 25 Feb 2018 20:59:20 +0800 Subject: [PATCH] feat(tsf): fix candidate selecting in preview preedit mode --- RimeWithWeasel/RimeWithWeasel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RimeWithWeasel/RimeWithWeasel.cpp b/RimeWithWeasel/RimeWithWeasel.cpp index 74803ba69..184155e23 100644 --- a/RimeWithWeasel/RimeWithWeasel.cpp +++ b/RimeWithWeasel/RimeWithWeasel.cpp @@ -463,7 +463,7 @@ bool RimeWithWeaselHandler::_Respond(UINT session_id, EatLine eat) case weasel::PREVIEW: if (ctx.menu.num_candidates > 0) { - std::string first = ctx.menu.candidates[0].text; + std::string first = ctx.menu.candidates[ctx.menu.highlighted_candidate_index].text; messages.push_back(std::string("ctx.preedit=") + first + '\n'); messages.push_back(std::string("ctx.preedit.cursor=") + std::to_string(utf8towcslen(first.c_str(), 0)) + ',' +