Fix partial snippet selection in desktop chat editors
This commit is contained in:
1 parent
63b7b879a3
commit
99db99e603
5 files changed
+45
-10
No files matched your search
+9
-3
@@ -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
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user