mirror of
https://github.com/magnars/multiple-cursors.el.git
synced 2025-10-13 13:03:03 +00:00
Save er/history for each cursor, to be able to contract.
This commit is contained in:
parent
a682c154a1
commit
9938acaf71
@ -119,6 +119,7 @@ Also makes a copy of the kill-ring to be used by this cursor."
|
||||
(overlay-put overlay 'mark-ring mark-ring)
|
||||
(overlay-put overlay 'mark-active mark-active)
|
||||
(overlay-put overlay 'mark (set-marker (make-marker) (mark)))
|
||||
(overlay-put overlay 'er/history er/history)
|
||||
(when (use-region-p)
|
||||
(overlay-put overlay 'region-overlay
|
||||
(mc/make-region-overlay-between-point-and-mark)))
|
||||
@ -133,6 +134,7 @@ cursor with updated info."
|
||||
(let ((current-kill-ring kill-ring)
|
||||
(current-mark-ring mark-ring)
|
||||
(current-mark-active mark-active)
|
||||
(current-er/history er/history)
|
||||
(annoying-arrows-mode nil))
|
||||
(save-excursion
|
||||
(mapc #'(lambda (o)
|
||||
@ -143,6 +145,7 @@ cursor with updated info."
|
||||
(set-marker (overlay-get o 'mark) nil)
|
||||
(setq mark-ring (overlay-get o 'mark-ring))
|
||||
(setq mark-active (overlay-get o 'mark-active))
|
||||
(setq er/history (overlay-get o 'er/history))
|
||||
(delete-region-overlay o)
|
||||
(delete-overlay o)
|
||||
(ignore-errors
|
||||
@ -152,7 +155,8 @@ cursor with updated info."
|
||||
(overlays-in (point-min) (point-max))))
|
||||
(setq kill-ring current-kill-ring)
|
||||
(setq mark-ring current-mark-ring)
|
||||
(setq mark-active current-mark-active)))
|
||||
(setq mark-active current-mark-active)
|
||||
(setq er/history current-er/history)))
|
||||
|
||||
(defun delete-region-overlay (o)
|
||||
(ignore-errors
|
||||
|
12
todo.org
12
todo.org
@ -1,10 +1,16 @@
|
||||
* TODO: [2/8]
|
||||
* TODO: [3/9]
|
||||
** DONE (set-marker MARKER nil) for performance
|
||||
** DONE C-g deactivates regions first, before disabling multiple-cursors
|
||||
** TODO remove mark-multiple integration
|
||||
** DONE more state to save per cursor: er/history
|
||||
** TODO refactor
|
||||
an object with all the current state, used for both overlays and current
|
||||
** TODO add tests
|
||||
** TODO more state to save per cursor: er/history
|
||||
** TODO collapse cursors at same point
|
||||
** TODO unknown command: (t)ry all or (i)gnore -> (did that work ok? (k)eep doing that or (d)on't)
|
||||
** TODO separate mark-multiple and multiple-cursors
|
||||
mark-multiple goes back to being the util? or just dies?
|
||||
given the problem with extract-var and undo, may just kill mark-multiple.
|
||||
problem with that is: C-g when doing rename-tag shouldn't go to multiple-cursors.
|
||||
|
||||
** TODO there's something going wrong with last-command/this-command?
|
||||
expand-region works nicely, even collapse when we save er/history, but last collapse puts all cursors in same spot
|
||||
|
Loading…
x
Reference in New Issue
Block a user