mirror of
https://github.com/magnars/multiple-cursors.el.git
synced 2025-10-14 05:13:05 +00:00
Make 'mc/mark-all-dwim' into 'mc/edit-lines' if prefix arg is passed
This commit is contained in:
parent
61388fedef
commit
af66635a05
@ -420,14 +420,18 @@ With prefix, it behaves the same as original `mc/mark-all-like-this'"
|
|||||||
"Tries even harder to guess what you want to mark all of.
|
"Tries even harder to guess what you want to mark all of.
|
||||||
|
|
||||||
If the region is active and spans multiple lines, it will behave
|
If the region is active and spans multiple lines, it will behave
|
||||||
as if `mc/mark-all-in-region'. Otherwise, it will delegate to
|
as if `mc/mark-all-in-region'. With the prefix ARG, it will call
|
||||||
`mc/mark-all-like-this-dwim' or `mc/mark-all-like-this' (if the
|
`mc/edit-lines' instead.
|
||||||
prefix ARG is present)"
|
|
||||||
|
If the region is inactive or on a single line, it will behave like
|
||||||
|
`mc/mark-all-like-this-dwim'."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(if (and (use-region-p)
|
(if (and (use-region-p)
|
||||||
(not (= (line-number-at-pos (region-beginning))
|
(not (= (line-number-at-pos (region-beginning))
|
||||||
(line-number-at-pos (region-end)))))
|
(line-number-at-pos (region-end)))))
|
||||||
(call-interactively 'mc/mark-all-in-region)
|
(if arg
|
||||||
|
(call-interactively 'mc/edit-lines)
|
||||||
|
(call-interactively 'mc/mark-all-in-region))
|
||||||
(progn
|
(progn
|
||||||
(setq this-command 'mc/mark-all-like-this-dwim)
|
(setq this-command 'mc/mark-all-like-this-dwim)
|
||||||
(mc/mark-all-like-this-dwim arg))))
|
(mc/mark-all-like-this-dwim arg))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user