File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/nextjournal/clojure_mode/extensions Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 79
79
(j/lit
80
80
{:create (constantly (.-none Decoration))
81
81
:update (j/fn [_value ^:js {:keys [state]}]
82
- (let [{:strs [Alt Shift Enter]} (get-modifier-field state)
82
+ (let [{:as field :strs [Shift Enter modifier]} (get-modifier-field state)
83
+ modifier-pressed? (get field modifier)
83
84
spec (if Enter mark-spec-highlight mark-spec)]
84
85
(if-some [range (when (or (n/embedded? state) (n/within-program? state))
85
- (cond (and Alt Shift) (top-level-node state)
86
- Alt (or (u/guard (main-selection state) #(not (j/get % :empty )))
87
- (cursor-range state))))]
86
+ (cond (and modifier-pressed? Shift) (top-level-node state)
87
+ modifier-pressed? (or (u/guard (main-selection state) #(not (j/get % :empty )))
88
+ (cursor-range state))))]
88
89
(single-mark spec range)
89
90
(.-none Decoration))))})))
90
91
106
107
handle-key-event (j/fn [^:js {:as event :keys [altKey shiftKey metaKey controlKey type]}
107
108
^:js {:as view :keys [state]}]
108
109
(let [prev (get-modifier-field state)
109
- next (cond-> {}
110
+ next (cond-> {" modifier " modifier }
110
111
altKey (assoc " Alt" true )
111
112
shiftKey (assoc " Shift" true )
112
113
metaKey (assoc " Meta" true )
You can’t perform that action at this time.
0 commit comments