mirror of
https://github.com/magnars/multiple-cursors.el.git
synced 2025-10-13 21:03:05 +00:00
Rename mc/(first|last)-cursor-(before|after)-point to mention that they operate on fake cursors
This commit is contained in:
parent
1ec78e195f
commit
2818d9e7ef
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
(eval-when-compile (require 'cl))
|
(eval-when-compile (require 'cl))
|
||||||
|
|
||||||
(defun mc/next-cursor-after-point ()
|
(defun mc/next-fake-cursor-after-point ()
|
||||||
(let ((pos (point))
|
(let ((pos (point))
|
||||||
(next-pos (point-max))
|
(next-pos (point-max))
|
||||||
next)
|
next)
|
||||||
@ -42,7 +42,7 @@
|
|||||||
(setq next cursor))))
|
(setq next cursor))))
|
||||||
next))
|
next))
|
||||||
|
|
||||||
(defun mc/prev-cursor-before-point ()
|
(defun mc/prev-fake-cursor-before-point ()
|
||||||
(let ((pos (point))
|
(let ((pos (point))
|
||||||
(prev-pos (point-min))
|
(prev-pos (point-min))
|
||||||
prev)
|
prev)
|
||||||
@ -68,7 +68,7 @@
|
|||||||
(continue 'continue)
|
(continue 'continue)
|
||||||
(stop 'stop)))
|
(stop 'stop)))
|
||||||
|
|
||||||
(defun mc/first-cursor-after (point)
|
(defun mc/first-fake-cursor-after (point)
|
||||||
"Very similar to mc/furthest-cursor-before-point, but ignores (mark) and (point)."
|
"Very similar to mc/furthest-cursor-before-point, but ignores (mark) and (point)."
|
||||||
(let* ((cursors (mc/all-fake-cursors))
|
(let* ((cursors (mc/all-fake-cursors))
|
||||||
(cursors-after-point (remove-if (lambda (cursor)
|
(cursors-after-point (remove-if (lambda (cursor)
|
||||||
@ -77,7 +77,7 @@
|
|||||||
(cursors-in-order (sort* cursors-after-point '< :key 'mc/cursor-beg)))
|
(cursors-in-order (sort* cursors-after-point '< :key 'mc/cursor-beg)))
|
||||||
(first cursors-in-order)))
|
(first cursors-in-order)))
|
||||||
|
|
||||||
(defun mc/last-cursor-before (point)
|
(defun mc/last-fake-cursor-before (point)
|
||||||
"Very similar to mc/furthest-cursor-before-point, but ignores (mark) and (point)."
|
"Very similar to mc/furthest-cursor-before-point, but ignores (mark) and (point)."
|
||||||
(let* ((cursors (mc/all-fake-cursors))
|
(let* ((cursors (mc/all-fake-cursors))
|
||||||
(cursors-before-point (remove-if (lambda (cursor)
|
(cursors-before-point (remove-if (lambda (cursor)
|
||||||
@ -97,14 +97,14 @@
|
|||||||
|
|
||||||
(defun mc/cycle-forward ()
|
(defun mc/cycle-forward ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(mc/cycle (mc/next-cursor-after-point)
|
(mc/cycle (mc/next-fake-cursor-after-point)
|
||||||
(mc/first-cursor-after (point-min))
|
(mc/first-fake-cursor-after (point-min))
|
||||||
"We're already at the last cursor."))
|
"We're already at the last cursor."))
|
||||||
|
|
||||||
(defun mc/cycle-backward ()
|
(defun mc/cycle-backward ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(mc/cycle (mc/prev-cursor-before-point)
|
(mc/cycle (mc/prev-fake-cursor-before-point)
|
||||||
(mc/last-cursor-before (point-max))
|
(mc/last-fake-cursor-before (point-max))
|
||||||
"We're already at the last cursor"))
|
"We're already at the last cursor"))
|
||||||
|
|
||||||
(define-key mc/keymap (kbd "C-v") 'mc/cycle-forward)
|
(define-key mc/keymap (kbd "C-v") 'mc/cycle-forward)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user