Skip to content

Commit 04086bd

Browse files
committed
Move the lens overlay when enter is pressed when being on next line
1 parent 663686a commit 04086bd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lsp-mode.el

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,11 @@ Results are meaningful only if FROM and TO are on the same line."
17301730

17311731
(defun lsp--lens-overlay-ensure-at (pos)
17321732
"Find or create a lens for the line at POS."
1733-
(or (car (cl-remove-if-not (lambda (ov) (lsp--lens-overlay-matches-pos ov pos)) lsp--lens-overlays))
1733+
(or (when-let ((ov (-first (lambda (ov) (lsp--lens-overlay-matches-pos ov pos)) lsp--lens-overlays)))
1734+
(save-excursion
1735+
(goto-char pos)
1736+
(move-overlay ov (point-at-bol) (1+ (point-at-eol))))
1737+
ov)
17341738
(let* ((ov (save-excursion
17351739
(goto-char pos)
17361740
(make-overlay (point-at-bol) (1+ (point-at-eol))))))

0 commit comments

Comments
 (0)