Release v0.6.13: correct words across punctuation keys

This commit is contained in:
2026-10-30 00:28:16 +02:00
parent 77f27ea087
commit 4cdcc92eb7
11 changed files with 51 additions and 18 deletions
+7 -3
View File
@@ -940,6 +940,7 @@ void App::transform(int command, int snippet)
std::wstring predicted;
for (wchar_t key : recent.keys)
predicted += key == L' ' ? L' ' : available[hint].at(physicalLayout().code(key));
expected = predicted;
if (!autoCorrector.suggest(predicted, hint, available, config) ||
!autoCorrectionAllowed(target, config) || !valid())
return;
@@ -979,9 +980,12 @@ void App::transform(int command, int snippet)
autoSelected = true;
Sleep(25);
text = tx.copy();
// Some editors first select only ") ". Extend by whole-word
// boundaries, then still verify against the complete tracked run.
for (int i = 0; i < 3 && autoClosingSelection(text, config) && tx.valid(); ++i)
// Editors may split hj,bnm at the comma. Extend only a verified
// suffix of the tracked input, and still require a complete match.
for (int i = 0; i < 3 && tx.valid() &&
matchAutoInput(recent, text, available, physicalLayout(), config) < 0 &&
(autoClosingSelection(text, config) ||
(!text.empty() && text.size() < expected.size() && expected.ends_with(text))); ++i)
{
if (!chord(VK_LEFT, MOD_CONTROL | MOD_SHIFT))
break;