Skip to content

Commit

Permalink
mostly fix cursor and mark position when the cursor is to the left of…
Browse files Browse the repository at this point in the history
… the mark
  • Loading branch information
Book-reader committed Oct 3, 2024
1 parent 8cbbb0d commit 2889083
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extensions/multiple-cursors/multiple-cursors.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
(define-command mark-next-like-this () ()
""
(if (buffer-mark-p (current-buffer))
(mark-like-this-direction (region-beginning (current-buffer)) (region-end (current-buffer))
(mark-like-this-direction (buffer-mark (current-buffer)) (buffer-point (current-buffer))
#'search-forward)
(add-cursors-to-next-line)))

(define-command mark-previous-like-this () ()
""
(if (buffer-mark-p (current-buffer))
(mark-like-this-direction (region-beginning (current-buffer)) (region-end (current-buffer))
(mark-like-this-direction (buffer-mark (current-buffer)) (buffer-point (current-buffer))
#'search-backward)
(add-cursors-to-previous-line)))

Expand Down Expand Up @@ -72,6 +72,7 @@
(with-point ((point point))
(if (search-next-matched point 1)
(progn
(setf (point-charpos point) (point-charpos end))
(setf cursor (make-fake-cursor point))
(dotimes (_ (- (point-linum end) (point-linum start)))
(if (equal direction #'search-forward)
Expand Down

0 comments on commit 2889083

Please sign in to comment.