Prefer the tracked layout when recent input matches several layouts
This commit is contained in:
1 parent
2869d584d8
commit
160cece79d
2 files changed
+28
-6
No files matched your search
@@ -449,6 +449,18 @@ int main(int argc, char **argv)
|
||||
"cycle does not use disabled English when all candidates are unchanged");
|
||||
require(ks::nextConversionLayout(L"123 ", layouts, {0, 1, 2}, 0) == 1,
|
||||
"unchanged digits finish after a bounded cycle");
|
||||
auto digitLayouts = layouts;
|
||||
digitLayouts[2].handle = reinterpret_cast<HKL>(static_cast<ULONG_PTR>(0xf0a80422));
|
||||
ks::Run digitRun;
|
||||
digitRun.layout = digitLayouts[2].handle;
|
||||
digitRun.keys = L"4732";
|
||||
const int digitSource = digitRun.match(L"4732", digitLayouts, en);
|
||||
require(digitSource == 2 && ks::nextConversionLayout(L"4732", digitLayouts, {1, 0, 2}, digitSource) == 1 &&
|
||||
ks::convertTo(L"4732", digitLayouts, 1, digitSource) == L"4732",
|
||||
"shared digits advance from the tracked Ukrainian layout to Russian without changing text");
|
||||
digitRun.keys = L"ghbdtn";
|
||||
require(digitRun.match(L"ghbdtn", digitLayouts, en) == 0,
|
||||
"recent input falls back when the tracked layout does not reproduce the selection");
|
||||
require(ks::nextConversionLayout(L"рф", layouts, {2, 0}, 1) == 0,
|
||||
"source outside cycle still skips unchanged candidates");
|
||||
require(ks::cycleCase(L"hello world") == L"Hello World", "title case");
|
||||
|
||||
Reference in new issue
Block a user