nextjournal / clojure-mode

Clojure/Script mode for CodeMirror 6
https://nextjournal.github.io/clojure-mode/
Eclipse Public License 2.0
158 stars 19 forks source link

Adam frey/scroll on kill #28

Closed zampino closed 2 years ago

zampino commented 2 years ago

Cherry picked from / closes #23.

I noticed when implementing clojure-mode on a tall page, whenever I tried the kill command (Ctrl-k) the kill would happen correctly but my page would get scrolled down to the bottom. This was because my browser was focusing on the temporary textarea element created in the copy-to-clipboard! function. Adding :preventScroll true fixed the problem for me.

Couldn't reproduce on Chrome but I find the change makes sense. I also think the original change could not have any effect.