[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 1ec78e1 162/434: Don't let mc/mark-lines
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 1ec78e1 162/434: Don't let mc/mark-lines create 'double' cursors. |
Date: |
Sat, 7 Aug 2021 09:20:17 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 1ec78e195f8cf9e0ee2a4e706269499f90dea263
Author: Marco Baringer <mb@bese.it>
Commit: Marco Baringer <mb@bese.it>
Don't let mc/mark-lines create 'double' cursors.
Previously using mc/mark-lines in a fowards/backwards/forwards
combination would cause multiple cursors to be placed at the same
point of the same line. This is not useful behaviour.
Noted while implementing magnars suggestion:
https://github.com/magnars/multiple-cursors.el/pull/23#commitcomment-1983183
---
features/mark-more.feature | 19 +++++++++++++++++++
mc-mark-more.el | 6 ++++--
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/features/mark-more.feature b/features/mark-more.feature
index c8cd3ff..8ca86f7 100644
--- a/features/mark-more.feature
+++ b/features/mark-more.feature
@@ -113,3 +113,22 @@ Feature: Marking multiple parts of the buffer
_ccc
"""
+ Scenario: Increasing number of cursors without an active region
+ When I insert:
+ """
+ aaa
+ bbb
+ ccc
+ """
+ And I go to the front of the word "bbb"
+ And I press "C->"
+ And I press "C-<"
+ And i press "C-f"
+ And I type "_"
+ Then I should have 3 cursors
+ And I should see:
+ """
+ a_aa
+ b_bb
+ c_cc
+ """
diff --git a/mc-mark-more.el b/mc-mark-more.el
index 8dd4bc6..7d722b0 100644
--- a/mc-mark-more.el
+++ b/mc-mark-more.el
@@ -145,8 +145,10 @@ With zero ARG, skip the last one and mark next."
(dotimes (i num-lines)
(mc/create-fake-cursor-at-point)
(ecase direction
- (forwards (next-line 1 nil))
- (backwards (previous-line 1 nil)))))
+ (forwards (loop do (next-line 1 nil)
+ while (mc/all-fake-cursors (point) (1+ (point)))))
+ (backwards (loop do (previous-line 1 nil)
+ while (mc/all-fake-cursors (point) (1+ (point))))))))
;;;###autoload
(defun mc/mark-next-lines (arg)
- [nongnu] elpa/multiple-cursors 0d89125 089/434: Added mc-version of mark-all-like-this, (continued)
- [nongnu] elpa/multiple-cursors 0d89125 089/434: Added mc-version of mark-all-like-this, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors f42e467 090/434: Added mc-version of mark-all-in-region, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b912bf8 096/434: Always require multiple-cursors-core, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 0233ba8 092/434: Add commands to run-once-list, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors ef2226b 116/434: Consolidate kill-ring entries when exiting multiple-cursors-mode, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d5a9d57 132/434: Add minibuffer-complete-and-exit to default run-once list., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b48e2b7 137/434: mc/edit-lines: Don't include the 'invisible' line, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors ae0033f 140/434: Protect post-command-hook from errors to avoids undead cursors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors fcbb7a4 152/434: Make mc/cycle-forward and mc/cycle-backward loop around by default., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 876937b 153/434: Use (interactive "P") instead of the weird (but equivalent) (interactive (list prefix-arg)), ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 1ec78e1 162/434: Don't let mc/mark-lines create 'double' cursors.,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors 1074c88 178/434: Added mc/mark-all-like-this-dwim, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 9582c72 204/434: Add mc/insert-numbers, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d534132 122/434: Remove todo.org - use issues instead, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors f7d393d 128/434: Don't use next-line and previous-line in non-interactive ways., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors fc59b63 131/434: Fix typo, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d98b85b 138/434: Bump to 1.1.2, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 6e9ea1a 149/434: Merge pull request #20 from tkf/diff-friendly-save-lists, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 6d4979d 144/434: Bump to 1.1.3, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b3ca408 171/434: Have to require 'cl for now, because of count-if., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors a6984a1 203/434: Merge pull request #53 from oneself/master, ELPA Syncer, 2021/08/07