mirror of
https://github.com/logseq/logseq.git
synced 2026-05-01 17:36:33 +00:00
fix: CTRL+X is deleting the last character when nothing is selected
fix #5821
This commit is contained in:
@@ -2957,14 +2957,18 @@
|
||||
"shortcut cut action:
|
||||
* when in selection mode, cut selected blocks
|
||||
* when in edit mode with text selected, cut selected text
|
||||
* otherwise same as delete shortcut"
|
||||
* otherwise nothing need to be handled."
|
||||
[e]
|
||||
(cond
|
||||
(state/selection?)
|
||||
(shortcut-cut-selection e)
|
||||
|
||||
(state/editing?)
|
||||
(keydown-backspace-handler true e)))
|
||||
(and (state/editing?) (util/input-text-selected?
|
||||
(gdom/getElement (state/get-edit-input-id))))
|
||||
(keydown-backspace-handler true e)
|
||||
|
||||
:else
|
||||
nil))
|
||||
|
||||
(defn delete-selection
|
||||
[e]
|
||||
|
||||
Reference in New Issue
Block a user