Merge pull request #4721 from keymanapp/fix/linux/4678

fix(linux): Fix switching to keyboard in middle of line (#4678)
This commit is contained in:
Eberhard Beilharz 2021-03-19 08:59:58 +01:00 • committed by GitHub
commit 6bae47cd3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View file

@ -364,8 +364,6 @@ int run_test(const km::kbp::path & source, const km::kbp::path & compiled) {
}
std::string string_to_hex(const std::u16string& input) {
static const char hex_digits[] = "0123456789ABCDEF";
std::ostringstream result;
result << std::setfill('0') << std::hex << std::uppercase;

View file

@ -220,7 +220,7 @@ static void reset_context(IBusEngine *engine)
g_message("new context is:%u:%s: cursor:%d anchor:%d", context_pos - context_start, surrounding_text, cursor_pos, anchor_pos);
g_message(":%s:%s:", surrounding_text, current_context_utf8);
if (g_strcmp0(surrounding_text, current_context_utf8) != 0)
if (!g_str_has_suffix(surrounding_text, current_context_utf8))
{
g_message("setting context because it has changed from expected");
if (km_kbp_context_items_from_utf8(surrounding_text, &context_items) == KM_KBP_STATUS_OK) {