mirror of
https://github.com/magnars/multiple-cursors.el.git
synced 2025-10-13 05:03:03 +00:00
Modified mc/mark-lines to allow skipping
This commit is contained in:
parent
6a62e60bf2
commit
9f4cdd0907
@ -227,13 +227,15 @@ With zero ARG, skip the last one and mark next."
|
||||
(mc/mark-previous-like-this arg)))
|
||||
|
||||
(defun mc/mark-lines (num-lines direction)
|
||||
(dotimes (i num-lines)
|
||||
(dotimes (i (if (= num-lines 0) 1 num-lines))
|
||||
(mc/save-excursion
|
||||
(let ((furthest-cursor (cl-ecase direction
|
||||
(forwards (mc/furthest-cursor-after-point))
|
||||
(backwards (mc/furthest-cursor-before-point)))))
|
||||
(if (overlayp furthest-cursor)
|
||||
(goto-char (overlay-get furthest-cursor 'point))))
|
||||
(when (overlayp furthest-cursor)
|
||||
(goto-char (overlay-get furthest-cursor 'point))
|
||||
(when (= num-lines 0)
|
||||
(mc/remove-fake-cursor furthest-cursor))))
|
||||
(cl-ecase direction
|
||||
(forwards (next-logical-line 1 nil))
|
||||
(backwards (previous-logical-line 1 nil)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user