[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors b48e2b7 137/434: mc/edit-lines: Don't inc
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors b48e2b7 137/434: mc/edit-lines: Don't include the 'invisible' line |
Date: |
Sat, 7 Aug 2021 09:20:12 -0400 (EDT) |
branch: elpa/multiple-cursors
commit b48e2b7682d98720f4f48a30472096fdccdb402a
Author: Magnar Sveen <magnars@gmail.com>
Commit: Magnar Sveen <magnars@gmail.com>
mc/edit-lines: Don't include the 'invisible' line
- when marking a region from bottom to top there is an invisible line
in the region if mark is at the beginning of the line.
- don't count that line when doing mc/edit-lines
---
features/edit-lines.feature | 12 ++++++++++++
mc-edit-lines.el | 9 +++++++--
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/features/edit-lines.feature b/features/edit-lines.feature
index de62c80..69c40a6 100644
--- a/features/edit-lines.feature
+++ b/features/edit-lines.feature
@@ -18,6 +18,18 @@ Feature: Switching from a multiline region to multiple
cursors
And I press "C-S-c C-S-c"
Then I should have 2 cursors
+ Scenario: Edit lines from bottom up
+ When I insert:
+ """
+ hello
+ there
+ """
+ And I go to the front of the word "there"
+ And I set the mark
+ And I go to the front of the word "hello"
+ And I press "C-S-c C-S-c"
+ Then I should have one cursor
+
Scenario: Edit only real lines, even in visual-line-mode
Given I turn on visual-line-mode
And I insert:
diff --git a/mc-edit-lines.el b/mc-edit-lines.el
index de6d343..76452cc 100644
--- a/mc-edit-lines.el
+++ b/mc-edit-lines.el
@@ -38,13 +38,18 @@ line point is on."
(when (not (use-region-p))
(error "Mark a set of lines first."))
(mc/remove-fake-cursors)
- (let* ((point-line (line-number-at-pos))
+ (let* ((col (current-column))
+ (point-line (line-number-at-pos))
(mark-line (progn (exchange-point-and-mark) (line-number-at-pos)))
(direction (if (< point-line mark-line) :up :down)))
(deactivate-mark)
+ (when (and (eq direction :up) (bolp))
+ (forward-line -1)
+ (move-to-column col))
(while (not (eq (line-number-at-pos) point-line))
(mc/create-fake-cursor-at-point)
- (if (eq direction :up) (forward-line -1) (forward-line 1)))
+ (if (eq direction :up) (forward-line -1) (forward-line 1))
+ (move-to-column col))
(multiple-cursors-mode)))
;;;###autoload
- [nongnu] elpa/multiple-cursors 533e157 335/434: Merge pull request #160 from P-Seebauer/master, (continued)
- [nongnu] elpa/multiple-cursors 533e157 335/434: Merge pull request #160 from P-Seebauer/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors ccdc025 079/434: Run prefix argument commands just once., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors df5f83a 082/434: Add more common commands to run only once., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 576bf90 087/434: mc version of mark-previous-like-this, ELPA Syncer, 2021/08/07
- [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 <=
- [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, 2021/08/07
- [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