Skip to content

Commit d5179c8

Browse files
committed
wip: desktop work
1 parent bd0a4f7 commit d5179c8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/desktop/src/components/code.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function Code(props: Props) {
9090
let ticking = false
9191
const onScroll = () => {
9292
if (!container) return
93-
if (ctx.file.active()?.path !== local.path) return
93+
// if (ctx.file.active()?.path !== local.path) return
9494
if (ticking) return
9595
ticking = true
9696
requestAnimationFrame(() => {
@@ -102,7 +102,7 @@ export function Code(props: Props) {
102102
const onSelectionChange = () => {
103103
if (!container) return
104104
if (isProgrammaticSelection) return
105-
if (ctx.file.active()?.path !== local.path) return
105+
// if (ctx.file.active()?.path !== local.path) return
106106
const d = getSelectionInContainer(container)
107107
if (!d) return
108108
const p = ctx.file.node(local.path)?.selection
@@ -112,7 +112,7 @@ export function Code(props: Props) {
112112

113113
const MOD = typeof navigator === "object" && /(Mac|iPod|iPhone|iPad)/.test(navigator.platform) ? "Meta" : "Control"
114114
const onKeyDown = (e: KeyboardEvent) => {
115-
if (ctx.file.active()?.path !== local.path) return
115+
// if (ctx.file.active()?.path !== local.path) return
116116
const ae = document.activeElement as HTMLElement | undefined
117117
const tag = (ae?.tagName || "").toLowerCase()
118118
const inputFocused = !!ae && (tag === "input" || tag === "textarea" || ae.isContentEditable)
@@ -155,7 +155,7 @@ export function Code(props: Props) {
155155
createEffect(() => {
156156
const content = html()
157157
if (!container || !content) return
158-
if (ctx.file.active()?.path !== local.path) return
158+
// if (ctx.file.active()?.path !== local.path) return
159159
const codeEl = container.querySelector("code") as HTMLElement | undefined
160160
if (!codeEl) return
161161
const target = ctx.file.node(local.path)?.selection

0 commit comments

Comments
 (0)