mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-21 02:22:40 +00:00
fix(tui): check for selected text instead of any selection in dialog escape handler (#16779)
This commit is contained in:
parent
d7093abf61
commit
a64f604d54
1 changed files with 1 additions and 1 deletions
|
|
@ -70,7 +70,7 @@ function init() {
|
|||
useKeyboard((evt) => {
|
||||
if (store.stack.length === 0) return
|
||||
if (evt.defaultPrevented) return
|
||||
if ((evt.name === "escape" || (evt.ctrl && evt.name === "c")) && renderer.getSelection()) return
|
||||
if ((evt.name === "escape" || (evt.ctrl && evt.name === "c")) && renderer.getSelection()?.getSelectedText()) return
|
||||
if (evt.name === "escape" || (evt.ctrl && evt.name === "c")) {
|
||||
const current = store.stack.at(-1)!
|
||||
current.onClose?.()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue