[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 719fe40 119/434: Integrate with rect.el i
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 719fe40 119/434: Integrate with rect.el instead of consolidating/splitting on kill-ring |
Date: |
Sat, 7 Aug 2021 09:20:08 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 719fe40ca3e2bacf45575e42d89534ac67abf424
Author: Magnar Sveen <magnars@gmail.com>
Commit: Magnar Sveen <magnars@gmail.com>
Integrate with rect.el instead of consolidating/splitting on kill-ring
---
features/multiple-cursors-core.feature | 27 ++-------------------------
multiple-cursors-core.el | 29 +++++------------------------
2 files changed, 7 insertions(+), 49 deletions(-)
diff --git a/features/multiple-cursors-core.feature
b/features/multiple-cursors-core.feature
index cba589b..64e3ae6 100644
--- a/features/multiple-cursors-core.feature
+++ b/features/multiple-cursors-core.feature
@@ -115,7 +115,7 @@ Feature: Multiple cursors core
And I press "C-y"
Then I should see "This externaltext contains the word externaltext twice"
- Scenario: Consolidated kill-ring after exiting multiple-cursors-mode
+ Scenario: Added to killed-rectangle after exiting multiple-cursors-mode
Given I have cursors at "text" in "This text contains the word text twice"
When I press "M-f"
And I press "C-f"
@@ -124,33 +124,10 @@ Feature: Multiple cursors core
And I press "M-w"
And I press "<return>"
And I press "C-a"
- And I press "C-y"
And I press "C-k"
+ And I press "C-x r y"
Then I should see:
"""
contains
twice
"""
-
- Scenario: Split multiline kill-ring entry over cursors when num lines match
- When I insert:
- """
- a
- b
- c
- """
- And I go to the front of the word "a"
- And I press "C-SPC"
- And I go to the end of the word "c"
- And I press "M-w"
- And I go to the end of the word "a"
- And I press "H-SPC"
- And I press "C-n"
- And I press "C-n"
- And I press "C-y"
- Then I should see:
- """
- aa
- bb
- cc
- """
diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index bf45e97..ca88228 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -27,6 +27,8 @@
(eval-when-compile (require 'cl))
+(require 'rect)
+
(defface mc/cursor-face
'((t (:inverse-video t)))
"The face used for fake cursors"
@@ -316,31 +318,10 @@ multiple cursors editing.")
(setq entries (cons (car (overlay-get cursor 'kill-ring)) entries)))
(reverse entries)))
-(defun mc--maybe-consolidate-kill-rings ()
+(defun mc--maybe-set-killed-rectangle ()
(let ((entries (mc--kill-ring-entries)))
(unless (mc--all-equal entries)
- (kill-new (mapconcat 'identity entries "\n")))))
-
-(defun mc--kill-new (entries)
- (mc/for-each-cursor-ordered
- (let ((kill-ring (overlay-get cursor 'kill-ring))
- (kill-ring-yank-pointer (overlay-get cursor 'kill-ring-yank-pointer)))
- (kill-new (car entries))
- (setq entries (cdr entries))
- (overlay-put cursor 'kill-ring kill-ring)
- (overlay-put cursor 'kill-ring-yank-pointer kill-ring-yank-pointer))))
-
-(defun mc--maybe-split-kill-ring ()
- (let ((entries (mc--kill-ring-entries)))
- (when (mc--all-equal entries)
- (let ((lines (split-string (car entries) "\n")))
- (when (= (mc/num-cursors) (length lines))
- (mc--kill-new lines))))))
-
-(defadvice yank (before maybe-split-kill-ring activate)
- (when (and (or multiple-cursors-mode rectangular-region-mode)
- (not mc--executing-command-for-fake-cursor))
- (mc--maybe-split-kill-ring)))
+ (setq killed-rectangle entries))))
(define-minor-mode multiple-cursors-mode
"Mode while multiple cursors are active."
@@ -350,7 +331,7 @@ multiple cursors editing.")
(add-hook 'post-command-hook 'mc/execute-this-command-for-all-cursors
t t)
(run-hooks 'multiple-cursors-mode-enabled-hook))
(remove-hook 'post-command-hook 'mc/execute-this-command-for-all-cursors t)
- (mc--maybe-consolidate-kill-rings)
+ (mc--maybe-set-killed-rectangle)
(mc/remove-fake-cursors)
(run-hooks 'multiple-cursors-mode-disabled-hook)))
- [nongnu] elpa/multiple-cursors 9980faa 419/434: Add dabbrev state variables to mc/cursor-specific-vars, (continued)
- [nongnu] elpa/multiple-cursors 9980faa 419/434: Add dabbrev state variables to mc/cursor-specific-vars, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 5ff2071 420/434: Merge pull request #351 from jrosdahl/dabbrev-expand, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 56d0373 075/434: Fix rectangular-region-mode when adding cursors over hidden areas of the buffer., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors c3c4544 083/434: Place the file definition with the save definition., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 39e4eb2 091/434: Added mc-version of mark-more-like-this-extended, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b72e016 098/434: Don't require mark-multiple., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 294d574 093/434: Update README, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b607794 110/434: Add config for travis-ci, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 32213d4 115/434: Make sure we run the right version of Emacs in travis., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 6e61e3d 114/434: Fix travis badge, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 719fe40 119/434: Integrate with rect.el instead of consolidating/splitting on kill-ring,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors 5fcc69c 139/434: Skip keyboard macros, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 3f20fc1 154/434: When no region is active mc/mark-next-like-this and mc/mark-previous-like-this should create a cursor one like up (or down)., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 038c9a7 161/434: Added stop as a possible value for mc/cycle-looping-behaviour., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors e4adefc 158/434: Fix issues with mc/cycle-(backward|forward) where the cycling was dependent on not having an active mark., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 1cdd730 221/434: Automatically select word/symbol, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 72ba43a 225/434: add .nosearch to directory with bundled libraries, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 6a5969e 202/434: Adding support for using mc/edit-lines without transient mark mode., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 980a880 223/434: Merge pull request #63 from tkf/select-thing-at-point, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors dce6c00 174/434: Add mc/cursor-specific-vars to handle vars that need to be tracked per cursor., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 0a081a7 184/434: Move mc/maybe-multiple-cursors-mode to core., ELPA Syncer, 2021/08/07