fix(tui): keep Zed context polling responsive (#24711)

This commit is contained in:
Kit Langton 2026-04-27 22:24:04 -04:00 committed by GitHub
parent 937a7c48a5
commit 4d74849c1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -116,6 +116,12 @@ export const { use: useEditorContext, provider: EditorContextProvider } = create
reconnect = setTimeout(connect, delay)
}
const scheduleZedPoll = () => {
if (closed) return
if (reconnect) clearTimeout(reconnect)
reconnect = setTimeout(connect, 1000)
}
const connect = () => {
if (closed) return
@ -145,7 +151,7 @@ export const { use: useEditorContext, provider: EditorContextProvider } = create
.finally(() => {
zedSelection = undefined
})
scheduleReconnect()
scheduleZedPoll()
return
}