Skip to content

Commit

Permalink
fix mark-next-like-this with multiple lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Book-reader committed Sep 9, 2024
1 parent 9dfa554 commit e11aec8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions extensions/multiple-cursors/multiple-cursors.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
:isearch-abort
:make-add-char-callback)
(:import-from :lem/buffer/internal
:point-linum)
:point-linum
:point-line
:point-change-line)
(:import-from :lem/buffer/line
:line-previous)
(:export :add-cursors-to-next-line
:add-cursors-to-previous-line
:mark-next-like-this)
Expand Down Expand Up @@ -70,7 +74,8 @@
(if (search-next-matched point 1)
(progn
(setf cursor (make-fake-cursor point))
(setf (point-linum point) (- (point-linum point) (- (point-linum end) (point-linum start))))
(dotimes (_ (- (point-linum end) (point-linum start)))
(point-change-line point (- (point-linum point) 1) (line-previous (point-line point))))
(setf (point-charpos point) (- (point-charpos point) (- (point-charpos end) (point-charpos start))))
(set-cursor-mark cursor point))
(message "No more matches"))))
Expand Down

0 comments on commit e11aec8

Please sign in to comment.