[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 89e360e 333/434: Merge pull request #193
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 89e360e 333/434: Merge pull request #193 from dovej/master |
Date: |
Sat, 7 Aug 2021 09:20:54 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 89e360e96c0a79c0fdc74476c388a8154a0a4e5e
Merge: 97f7b1d 2d6ffce
Author: Magnar Sveen <magnars@gmail.com>
Commit: Magnar Sveen <magnars@gmail.com>
Merge pull request #193 from dovej/master
Support unmarking with no region. Change mc/mark-lines to preserve point...
---
mc-mark-more.el | 48 ++++++++++++++++++++++++++----------------------
1 file changed, 26 insertions(+), 22 deletions(-)
diff --git a/mc-mark-more.el b/mc-mark-more.el
index 45a87fc..eed0035 100644
--- a/mc-mark-more.el
+++ b/mc-mark-more.el
@@ -127,14 +127,14 @@ Use like case-fold-search, don't recommend setting it
globally.")
With negative ARG, delete the last one instead.
With zero ARG, skip the last one and mark next."
(interactive "p")
- (if (region-active-p)
- (if (< arg 0)
- (let ((cursor (mc/furthest-cursor-after-point)))
- (if cursor
- (mc/remove-fake-cursor cursor)
- (error "No cursors to be unmarked")))
- (mc/mark-more-like-this (= arg 0) 'forwards))
- (mc/mark-lines arg 'forwards))
+ (if (< arg 0)
+ (let ((cursor (mc/furthest-cursor-after-point)))
+ (if cursor
+ (mc/remove-fake-cursor cursor)
+ (error "No cursors to be unmarked")))
+ (if (region-active-p)
+ (mc/mark-more-like-this (= arg 0) 'forwards)
+ (mc/mark-lines arg 'forwards)))
(mc/maybe-multiple-cursors-mode))
;;;###autoload
@@ -155,14 +155,14 @@ With zero ARG, skip the last one and mark next."
With negative ARG, delete the last one instead.
With zero ARG, skip the last one and mark next."
(interactive "p")
- (if (region-active-p)
- (if (< arg 0)
- (let ((cursor (mc/furthest-cursor-before-point)))
- (if cursor
- (mc/remove-fake-cursor cursor)
- (error "No cursors to be unmarked")))
- (mc/mark-more-like-this (= arg 0) 'backwards))
- (mc/mark-lines arg 'backwards))
+ (if (< arg 0)
+ (let ((cursor (mc/furthest-cursor-before-point)))
+ (if cursor
+ (mc/remove-fake-cursor cursor)
+ (error "No cursors to be unmarked")))
+ (if (region-active-p)
+ (mc/mark-more-like-this (= arg 0) 'backwards)
+ (mc/mark-lines arg 'backwards)))
(mc/maybe-multiple-cursors-mode))
;;;###autoload
@@ -179,12 +179,16 @@ With zero ARG, skip the last one and mark next."
(defun mc/mark-lines (num-lines direction)
(dotimes (i num-lines)
- (mc/create-fake-cursor-at-point)
- (ecase direction
- (forwards (loop do (next-logical-line 1 nil)
- while (mc/all-fake-cursors (point) (1+ (point)))))
- (backwards (loop do (previous-logical-line 1 nil)
- while (mc/all-fake-cursors (point) (1+ (point))))))))
+ (mc/save-excursion
+ (let ((furthest-cursor (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))))
+ (ecase direction
+ (forwards (next-logical-line 1 nil))
+ (backwards (previous-logical-line 1 nil)))
+ (mc/create-fake-cursor-at-point))))
;;;###autoload
(defun mc/mark-next-lines (arg)
- [nongnu] elpa/multiple-cursors 239acbf 281/434: Skip folded lines with mc/edit-lines, (continued)
- [nongnu] elpa/multiple-cursors 239acbf 281/434: Skip folded lines with mc/edit-lines, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 5cd6ddf 293/434: Merge pull request #125 from kyanagi/fix-cycle-cursors-on-edge, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d1ad51f 296/434: Gitignore *.elc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors a3e6ec7 297/434: Merge pull request #135 from jistr/gitignore_elc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors fc39dab 299/434: Adds jedi-mode to list of unsupported minor modes, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors da2a9ab 298/434: Add mc/mark-all-in-region-regexp, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 7ddda85 312/434: Added vertical align commands, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 912342e 315/434: Add missing ###autoload markers, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 66eefa2 317/434: Add cperl-electric-backspace to default run-for-all list, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors dc1bfbf 325/434: Add cua-delete-region to default run-for-all, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 89e360e 333/434: Merge pull request #193 from dovej/master,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors 4969d38 331/434: Move mc/list-file to the user-emacs-directory, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 49c9f7f 340/434: Merge remote-tracking branch 'upstream/master', ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 9b53e89 344/434: Merge pull request #203 from dovej/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors ca822cd 347/434: Add mc/insert-letters function and test cases, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 54c05c3 356/434: Add more aliases for cl stuff, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 40eb74e 357/434: Extend mc/add-cursor-on-click to toggle fake cursors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 06a2985 362/434: * mc-mark-more.el (mc/mark-all-in-region-regexp): Don't infloop when regexp matches empty string, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 4bf9860 364/434: Use cl-lib instead of shimming, which breaks in older emacsen, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d5b544e 365/434: Merge pull request #246 from purcell/cl-lib, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b3bd49c 372/434: Bump version to 1.4.0, ELPA Syncer, 2021/08/07