emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/multiple-cursors 9f4cdd0 368/434: Modified mc/mark-lines t


From: ELPA Syncer
Subject: [nongnu] elpa/multiple-cursors 9f4cdd0 368/434: Modified mc/mark-lines to allow skipping
Date: Sat, 7 Aug 2021 09:21:01 -0400 (EDT)

branch: elpa/multiple-cursors
commit 9f4cdd0907af7a147e5a4f09cddeb7407fe97ce5
Author: Josh Hunsaker <jph@rincon.com>
Commit: Josh Hunsaker <jph@rincon.com>

    Modified mc/mark-lines to allow skipping
---
 mc-mark-more.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/mc-mark-more.el b/mc-mark-more.el
index be4f1d9..9f31262 100644
--- a/mc-mark-more.el
+++ b/mc-mark-more.el
@@ -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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]