Skip to content

Commit

Permalink
Fix clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
wengxt committed Jan 18, 2025
1 parent eeed2b6 commit d4d4f16
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ void LibThaiEngine::keyEvent(const InputMethodEntry & /*entry*/,
prevChar = prevChars.back();
}
if (!th_isaccept(prevChar, newChar, *config_.strictness)) {
keyEvent.filterAndAccept(); return;
keyEvent.filterAndAccept();
return;
}
if (state->commitString(&newChar, 1)) {
keyEvent.filterAndAccept();
Expand All @@ -223,14 +224,16 @@ void LibThaiEngine::keyEvent(const InputMethodEntry & /*entry*/,
state->prevCell(&contextCell);
if (!th_validate_leveled(contextCell, newChar, &conv,
*config_.strictness)) {
keyEvent.filterAndAccept(); return;
keyEvent.filterAndAccept();
return;
}

if (conv.offset < 0) {
// SurroundingText not supported, so just reject the key.
if (!keyEvent.inputContext()->capabilityFlags().test(
CapabilityFlag::SurroundingText)) {
keyEvent.filter(); return;
keyEvent.filter();
return;
}

keyEvent.inputContext()->deleteSurroundingText(conv.offset,
Expand All @@ -240,11 +243,13 @@ void LibThaiEngine::keyEvent(const InputMethodEntry & /*entry*/,
state->rememberPrevChars(newChar);
if (state->commitString(conv.conv,
strlen(reinterpret_cast<char *>(conv.conv)))) {
keyEvent.filterAndAccept(); return;
keyEvent.filterAndAccept();
return;
}
}

void LibThaiEngine::reset(const InputMethodEntry & /*entry*/, InputContextEvent &event) {
void LibThaiEngine::reset(const InputMethodEntry & /*entry*/,
InputContextEvent &event) {
auto *state = event.inputContext()->propertyFor(&factory_);
state->forgetPrevChars();
}
Expand Down

0 comments on commit d4d4f16

Please sign in to comment.