mirror of
https://github.com/magnars/multiple-cursors.el.git
synced 2025-10-13 13:03:03 +00:00
Add mc/mark-all-dwim
This commit is contained in:
parent
186cb3b63f
commit
45c6cd0be4
@ -416,6 +416,22 @@ With prefix, it behaves the same as original `mc/mark-all-like-this'"
|
||||
(when (<= (mc/num-cursors) before)
|
||||
(mc/mark-all-like-this))))))
|
||||
|
||||
(defun mc/mark-all-dwim (arg)
|
||||
"Tries even harder to guess what you want to mark all of.
|
||||
|
||||
If the region is active and spans multiple lines, it will behave
|
||||
as if `mc/mark-all-in-region'. Otherwise, it will delegate to
|
||||
`mc/mark-all-like-this-dwim' or `mc/mark-all-like-this' (if the
|
||||
prefix ARG is present)"
|
||||
(interactive "P")
|
||||
(if (and (use-region-p)
|
||||
(not (= (line-number-at-pos (region-beginning))
|
||||
(line-number-at-pos (region-end)))))
|
||||
(call-interactively 'mc/mark-all-in-region)
|
||||
(progn
|
||||
(setq this-command 'mc/mark-all-like-this-dwim)
|
||||
(mc/mark-all-like-this-dwim arg))))
|
||||
|
||||
(defun mc--in-defun ()
|
||||
(bounds-of-thing-at-point 'defun))
|
||||
|
||||
|
@ -573,6 +573,7 @@ for running commands with multiple cursors.")
|
||||
mc/mark-all-words-like-this-in-defun
|
||||
mc/mark-all-symbols-like-this-in-defun
|
||||
mc/mark-all-like-this-dwim
|
||||
mc/mark-all-dwim
|
||||
mc/mark-sgml-tag-pair
|
||||
mc/insert-numbers
|
||||
mc/sort-regions
|
||||
|
Loading…
x
Reference in New Issue
Block a user