mirror of
https://github.com/aaddrick/claude-desktop-debian.git
synced 2026-05-17 08:36:35 +03:00
build.sh: improve regexp quick window patch regexp readibility (#420)
* build.sh: improve regexp quick window patch regexp readibility * docs(readme): credit @Andrej730 for quick-window regex readability Co-Authored-By: Claude <claude@anthropic.com> --------- Co-authored-by: aaddrick <aaddrick@gmail.com> Co-authored-by: Claude <claude@anthropic.com>
This commit is contained in:
@@ -243,6 +243,7 @@ Special thanks to:
|
||||
- **[davidamacey](https://github.com/davidamacey)** for identifying and fixing the XRDP GPU compositing blank-window issue on remote desktop sessions
|
||||
- **[pb3ck](https://github.com/pb3ck)** for diagnosing the Cowork `CLAUDE_CODE_OAUTH_TOKEN` env-strip bug with a working reference diff
|
||||
- **[aJV99](https://github.com/aJV99)** for exporting `GDK_BACKEND=wayland` in native Wayland mode to fix XWayland fallback blur on HiDPI displays
|
||||
- **[Andrej730](https://github.com/Andrej730)** for the quick-window regex readability refactor (`String.raw` + `escapeRegExp` helper)
|
||||
|
||||
## Sponsorship
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ const anchors = [
|
||||
'Navigating to existing chat',
|
||||
'Creating new chat with submit_quick_entry',
|
||||
];
|
||||
const escapeRegExp = s => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
for (const anchor of anchors) {
|
||||
const anchorIdx = code.indexOf(anchor);
|
||||
if (anchorIdx === -1) {
|
||||
@@ -98,9 +99,9 @@ for (const anchor of anchors) {
|
||||
anchor.substring(0, 30) + '..."');
|
||||
continue;
|
||||
}
|
||||
// matches: <focusFn>()||(someVar).show()
|
||||
const showRe = new RegExp(
|
||||
focusFn.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') +
|
||||
'\\(\\)\\|\\|(\\w+)\\.show\\(\\)'
|
||||
escapeRegExp(focusFn) + String.raw`\(\)\|\|(\w+)\.show\(\)`
|
||||
);
|
||||
const showMatch = region.match(showRe);
|
||||
if (showMatch) {
|
||||
|
||||
Reference in New Issue
Block a user