The open source coding agent.
TypeScript
wip: desktop work
Adamd5179c8b634f
diff --git a/packages/desktop/src/components/code.tsx b/packages/desktop/src/components/code.tsxindex c214fd5e6b6..325f7b635ac 100644--- a/packages/desktop/src/components/code.tsx+++ b/packages/desktop/src/components/code.tsx@@ -90,7 +90,7 @@ export function Code(props: Props) {let ticking = falseconst onScroll = () => {if (!container) return- if (ctx.file.active()?.path !== local.path) return+ // if (ctx.file.active()?.path !== local.path) returnif (ticking) returnticking = truerequestAnimationFrame(() => {@@ -102,7 +102,7 @@ export function Code(props: Props) {const onSelectionChange = () => {if (!container) returnif (isProgrammaticSelection) return- if (ctx.file.active()?.path !== local.path) return+ // if (ctx.file.active()?.path !== local.path) returnconst d = getSelectionInContainer(container)if (!d) returnconst p = ctx.file.node(local.path)?.selection@@ -112,7 +112,7 @@ export function Code(props: Props) {const MOD = typeof navigator === "object" && /(Mac|iPod|iPhone|iPad)/.test(navigator.platform) ? "Meta" : "Control"const onKeyDown = (e: KeyboardEvent) => {- if (ctx.file.active()?.path !== local.path) return+ // if (ctx.file.active()?.path !== local.path) returnconst ae = document.activeElement as HTMLElement | undefinedconst tag = (ae?.tagName || "").toLowerCase()const inputFocused = !!ae && (tag === "input" || tag === "textarea" || ae.isContentEditable)@@ -155,7 +155,7 @@ export function Code(props: Props) {createEffect(() => {const content = html()if (!container || !content) return- if (ctx.file.active()?.path !== local.path) return+ // if (ctx.file.active()?.path !== local.path) returnconst codeEl = container.querySelector("code") as HTMLElement | undefinedif (!codeEl) returnconst target = ctx.file.node(local.path)?.selection