Commit 9bc66bc6 authored by Bruno Burke's avatar Bruno Burke 🍔
Browse files

allow copy on read-only code-editors

parent 78bc2afd
Pipeline #107978 passed with stages
in 6 minutes and 4 seconds
......@@ -57,10 +57,13 @@
js/CodeMirror dom-node
(clj->js {:mode syntax-language
:readOnly (when (true? read-only)
true ;;; this will allow copy on readonly code-editors
:lineNumbers true}))]
(.on cm-editor "change" #(on-change (.getValue cm-editor)))
(.on cm-editor "copy" (fn [cm e]
(set! (.-codemirrorIgnore e) true)))
(.setOption cm-editor "mode" syntax-language)
(.setValue cm-editor (or code ""))
;(.setSize cm-editor nil 200)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment