Skip to content

Commit 066e74b

Browse files
authored
lsp-lens: fix overlay location to avoid conflict with lsp-ui-sideline (#4847)
* lsp-lens: fix overlay location to avoid conflict with lsp-ui-sideline * lsp-lens: fix a failed lsp-lens CI test
1 parent f752629 commit 066e74b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lsp-lens.el

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,10 @@ Results are meaningful only if FROM and TO are on the same line."
103103
"Find or create a lens for the line at POS."
104104
(-doto (save-excursion
105105
(goto-char pos)
106-
(if (eq 'end-of-line lsp-lens-place-position)
107-
(make-overlay (line-end-position) -1 nil t t)
108-
(make-overlay (line-beginning-position) (1+ (line-end-position)) nil t t)))
106+
(let ((eol (line-end-position)))
107+
(if (eq 'end-of-line lsp-lens-place-position)
108+
(make-overlay eol eol nil t t)
109+
(make-overlay (line-beginning-position) (1+ eol) nil t t))))
109110
(overlay-put 'lsp-lens t)
110111
(overlay-put 'lsp-lens-position pos)))
111112

test/lsp-mock-server-test.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,6 @@ line 3 words here and here
862862
(should (string-match-p "My command"
863863
(overlay-get (car lenses) 'after-string)))
864864
(goto-char (overlay-start (car lenses)))
865-
(should (equal (line-number-at-pos) (- line 1)))))))
865+
(should (equal (line-number-at-pos) (+ line 1)))))))
866866

867867
;;; lsp-mock-server-test.el ends here

0 commit comments

Comments
 (0)