Skip to content

Commit

Permalink
commit text transferred by json.
Browse files Browse the repository at this point in the history
  • Loading branch information
fxliang committed Jul 25, 2023
1 parent c5d8c1b commit 7b8caeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion RimeWithWeasel/RimeWithWeasel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,8 @@ bool RimeWithWeaselHandler::_Respond(UINT session_id, EatLine eat)
if (RimeGetCommit(session_id, &commit))
{
actions.insert("commit");
messages.push_back(std::string("commit=") + commit.text + '\n');
json j = string_to_wstring(commit.text, CP_UTF8);
messages.push_back(std::string("commit=") + j.dump() + '\n');
RimeFreeCommit(&commit);
}

Expand Down
5 changes: 4 additions & 1 deletion WeaselIPC/Committer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ void Committer::Store(Deserializer::KeyType const& key, std::wstring const& valu
if (!m_pTarget->p_commit)
return;
if (key.size() == 1)
*m_pTarget->p_commit = value;
{
json j = json::parse(value);
j.get_to(*m_pTarget->p_commit);
}
}

0 comments on commit 7b8caeb

Please sign in to comment.