branch: elpa/multiple-cursors
commit af66635a0598f26fb9b08e74908496f7690e10e7
Author: Maciej Katafiasz <[email protected]>
Commit: Maciej Katafiasz <[email protected]>
Make 'mc/mark-all-dwim' into 'mc/edit-lines' if prefix arg is passed
---
mc-mark-more.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/mc-mark-more.el b/mc-mark-more.el
index 26bbe6f..02afcab 100644
--- a/mc-mark-more.el
+++ b/mc-mark-more.el
@@ -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.
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)"
+as if `mc/mark-all-in-region'. With the prefix ARG, it will call
+`mc/edit-lines' instead.
+
+If the region is inactive or on a single line, it will behave like
+`mc/mark-all-like-this-dwim'."
(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)
+ (if arg
+ (call-interactively 'mc/edit-lines)
+ (call-interactively 'mc/mark-all-in-region))
(progn
(setq this-command 'mc/mark-all-like-this-dwim)
(mc/mark-all-like-this-dwim arg))))