diff options
author | bptato <nincsnevem662@gmail.com> | 2024-02-13 01:21:39 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-02-13 01:23:29 +0100 |
commit | 955f5baca85203fbf21f9e734828d694a44777b1 (patch) | |
tree | 75398feef3b3f0da707121ad5e376421a58290e7 /src/server | |
parent | 178a5357136a225136691c78216536d7897ecba6 (diff) | |
download | chawan-955f5baca85203fbf21f9e734828d694a44777b1.tar.gz |
buffer: fix wrong click behavior with JS
do_reshape could move the target element, and thus call click on the wrong clickable.
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/buffer.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim index a5858e44..d0a50284 100644 --- a/src/server/buffer.nim +++ b/src/server/buffer.nim @@ -1545,13 +1545,13 @@ proc click*(buffer: Buffer, cursorx, cursory: int): ClickResult {.proxy.} = if buffer.lines.len <= cursory: return var called = false var canceled = false + let clickable = buffer.getCursorClickable(cursorx, cursory) if buffer.config.scripting: let elem = buffer.getCursorElement(cursorx, cursory) (called, canceled) = buffer.dispatchEvent("click", elem) if called: buffer.do_reshape() if not canceled: - let clickable = buffer.getCursorClickable(cursorx, cursory) if clickable != nil: var res = buffer.click(clickable) res.repaint = called |