Fix partial snippet selection in desktop chat editors

This commit is contained in:
agrynco committed 2026-11-06 14:58:24 +02:00
1 parent 63b7b879a3
commit 99db99e603
5 files changed
+45 -10

No files matched your search

+9 -3
View File
@@ -1490,11 +1490,17 @@ void App::transform(int command, int snippet)
}
Run tail = recent;
tail.keys = tail.keys.substr(tail.keys.size() - sn.trigger.size());
if (!tx.select(sn.trigger.size()))
return;
autoSelected = true;
reason = L"snippet-verification-mismatch";
text = tx.copy();
if (farSnippet)
{
if (!tx.select(sn.trigger.size())) return;
text = tx.copy();
}
else
text = tx.copyRange(sn.trigger.size(), tail.keys,
[&](const std::wstring &candidate) { return tail.match(candidate, available, physicalLayout()) >= 0; },
[&](const std::wstring &candidate) { return tail.matchSuffix(candidate, available, physicalLayout()) >= 0; });
if (tail.match(text, available, physicalLayout()) < 0)
return;
automatic = true;
+1 -1
View File
@@ -435,7 +435,7 @@ bool needsSelectionDelay(HWND target)
{
const auto name = lower(processName(target));
return name == L"ms-teams" || name == L"msedgewebview2" ||
name == L"chrome" || name == L"msedge";
name == L"chrome" || name == L"msedge" || name == L"chatgpt" || name == L"codex";
}
bool selectPrevious(size_t count, const std::function<bool()> &valid)
{