[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 952877f 324/434: Revert undo-feature for
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 952877f 324/434: Revert undo-feature for multiple-cursors |
Date: |
Sat, 7 Aug 2021 09:20:52 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 952877fc5bc593d9ea47d7ef764e89f5cb0e9404
Author: Magnar Sveen <magnars@gmail.com>
Commit: Magnar Sveen <magnars@gmail.com>
Revert undo-feature for multiple-cursors
re #169
---
README.md | 2 +-
features/multiple-cursors-core.feature | 20 -----------------
multiple-cursors-core.el | 41 ----------------------------------
3 files changed, 1 insertion(+), 62 deletions(-)
diff --git a/README.md b/README.md
index 58eb4c2..d97345a 100644
--- a/README.md
+++ b/README.md
@@ -185,7 +185,7 @@ Run the tests with:
* [Fuco](https://github.com/Fuco1) added the first version of
`mc/mark-all-like-this-dwim`
* [Zach Kost-Smith](https://github.com/smithzvk) added `mc/mark-pop`
* [Maciej Katafiasz](https://github.com/mathrick) added `mc/mark-all-dwim`
-* [Aleksey Fedotov](https://github.com/lexa) added
`mc-hide-unmatched-lines-mode` and made undo restore your cursors after leaving
mc-mode.
+* [Aleksey Fedotov](https://github.com/lexa) added
`mc-hide-unmatched-lines-mode`
Thanks!
diff --git a/features/multiple-cursors-core.feature
b/features/multiple-cursors-core.feature
index 73259f8..0a6e8b9 100644
--- a/features/multiple-cursors-core.feature
+++ b/features/multiple-cursors-core.feature
@@ -65,26 +65,6 @@ Feature: Multiple cursors core
And I type "!"
Then I should see "This text! contains the word text! twice"
- Scenario: Undo mode
- Given I have cursors at "text" in "This text contains the word text twice"
- When I press "C-g"
- And I press "M-f"
- And I press "C-_"
- And I type "!"
- Then I should see "This !text contains the word !text twice"
-
- Scenario: Undo until mc mode will be disabled
- Given I have cursors at "text" in "This text contains the word text twice"
- And I should have 2 cursors
- When I press "C-g"
- And I should have 1 cursors
- And I press "C-_"
- And I should have 2 cursors
- And I press "C-_"
- And I should have 1 cursors
- And I type "!"
- Then I should see "This !text contains the word text twice"
-
Scenario: Setting and popping mark
Given I have cursors at "text" in "This text contains the word text twice"
And I press "C-SPC"
diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index 2c76b42..d2b2c42 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -52,14 +52,6 @@
(setq buffer-undo-list ;; otherwise add a function to activate this
cursor
(cons (cons 'apply (cons 'activate-cursor-for-undo (list id)))
buffer-undo-list))))))
-
-(defun mc/get-all-fake-cursors-state ()
- "Return list of all fake cursor states
-like this: ((CURSOR-POS MARK-POSITION (list of cursor specific variables))
...)"
- (mapcar (lambda (cursor)
- (mc/get-state-from-overlay cursor))
- (mc/all-fake-cursors)))
-
(defun mc/all-fake-cursors (&optional start end)
(remove-if-not 'mc/fake-cursor-p
(overlays-in (or start (point-min))
@@ -160,23 +152,6 @@ highlights the entire width of the window."
(dolist (var mc/cursor-specific-vars)
(when (boundp var) (set var (overlay-get o var)))))
-(defun mc/get-state-from-overlay (o)
- "Return list describing state of cursor overlay"
- (list
- (marker-position (overlay-get o 'point))
- (marker-position (overlay-get o 'mark))
- (mapcar (lambda (var)
- (when (boundp var) (cons var (overlay-get o var))))
- mc/cursor-specific-vars)))
-
-(defun mc/create-overlay-from-state (point mark cursor-vars)
- "Creates cursor overlay according to cursor-info"
- (goto-char point)
- (push-mark mark t)
- (loop for (var . value) in cursor-vars
- do (setq var value))
- (mc/create-fake-cursor-at-point))
-
(defun mc/remove-fake-cursor (o)
"Delete overlay with state, including dependent overlays and markers."
(set-marker (overlay-get o 'point) nil)
@@ -484,20 +459,6 @@ They are temporarily disabled when multiple-cursors are
active.")
:group 'multiple-cursors)
(put 'mc/mode-line 'risky-local-variable t)
-(defun mc/restore-mode (real-cursor real-mark fake-cursors)
- "Restore state of mc mode after undo"
- (save-excursion
- ;; remove all existing fake cursors
- (when multiple-cursors-mode
- (mc/remove-fake-cursors))
- ;; and create set a new one
- (mapc #'(lambda (cursor)
- (apply 'mc/create-overlay-from-state cursor))
- fake-cursors))
- (goto-char real-cursor)
- (push-mark real-mark t)
- (multiple-cursors-mode t))
-
;;;###autoload
(define-minor-mode multiple-cursors-mode
"Mode while multiple cursors are active."
@@ -505,13 +466,11 @@ They are temporarily disabled when multiple-cursors are
active.")
(if multiple-cursors-mode
(progn
(mc/temporarily-disable-unsupported-minor-modes)
- (push `(apply multiple-cursors-mode . ,(list 0)) buffer-undo-list)
(add-hook 'pre-command-hook 'mc/make-a-note-of-the-command-being-run
nil t)
(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)
(remove-hook 'pre-command-hook 'mc/make-a-note-of-the-command-being-run t)
- (push `(apply mc/restore-mode . ,(list (point) (mark)
(mc/get-all-fake-cursors-state))) buffer-undo-list)
(setq mc--this-command nil)
(mc--maybe-set-killed-rectangle)
(mc/remove-fake-cursors)
- [nongnu] elpa/multiple-cursors 6cac5f4 018/434: Even more white-listing., (continued)
- [nongnu] elpa/multiple-cursors 6cac5f4 018/434: Even more white-listing., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors f2da52a 085/434: Update readme with new testing info., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 8bc7916 094/434: Updated README., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 3e31cc6 101/434: Merge pull request #5 from milkypostman/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors f2add1d 107/434: Suggest C-c C-< instead of the often used M-<, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 810636b 120/434: Avoid smooth-scroll issues with multiple cursors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 2d639b0 284/434: Added tests for new mc/edit-lines, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 38e590c 292/434: Fix cycle-cursor behavior., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors adf86bd 320/434: Add @lexa to list of contributors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors ff0ac1f 322/434: Add function to disable mc undo into undo-list., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 952877f 324/434: Revert undo-feature for multiple-cursors,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors 72b4bf3 329/434: Enable to specify search word in mc/mark-all-in-region, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 97f7b1d 332/434: Merge pull request #197 from kissge/user-emacs-directory, ELPA Syncer, 2021/08/07
- [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