diff options
| author | Adam <[email protected]> | 2025-11-03 15:42:39 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-11-03 15:42:39 -0600 |
| commit | d5179c8b634faaa1b59816945ab3067ae3281570 (patch) | |
| tree | 508c9b052d21682831bbf7af24cbcdd19d5f77b1 | |
| parent | bd0a4f7bbef079265289e9a83f43273f489ca6f9 (diff) | |
| download | opencode-d5179c8b634faaa1b59816945ab3067ae3281570.tar.gz opencode-d5179c8b634faaa1b59816945ab3067ae3281570.zip | |
wip: desktop work
| -rw-r--r-- | packages/desktop/src/components/code.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/desktop/src/components/code.tsx b/packages/desktop/src/components/code.tsx index c214fd5e6..325f7b635 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 = false const onScroll = () => { if (!container) return - if (ctx.file.active()?.path !== local.path) return + // if (ctx.file.active()?.path !== local.path) return if (ticking) return ticking = true requestAnimationFrame(() => { @@ -102,7 +102,7 @@ export function Code(props: Props) { const onSelectionChange = () => { if (!container) return if (isProgrammaticSelection) return - if (ctx.file.active()?.path !== local.path) return + // if (ctx.file.active()?.path !== local.path) return const d = getSelectionInContainer(container) if (!d) return const 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) return const ae = document.activeElement as HTMLElement | undefined const 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) return const codeEl = container.querySelector("code") as HTMLElement | undefined if (!codeEl) return const target = ctx.file.node(local.path)?.selection |
