Skip to content

Commit 7e947c3

Browse files
committed
Keep file path suffix if it exceeds peek list width
1 parent 295d898 commit 7e947c3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lsp-ui-peek.el

+8-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,14 @@ XREFS is a list of references/definitions."
314314
(len-str (number-to-string count)))
315315
(setq lsp-ui-peek--size-list (+ lsp-ui-peek--size-list count))
316316
(push (concat (propertize (if lsp-ui-peek-show-directory
317-
(lsp-ui--workspace-path filename)
317+
(let ((path (lsp-ui--workspace-path filename)))
318+
(if (> (length path) lsp-ui-peek-list-width)
319+
(let* ((path (substring path (- (length path) lsp-ui-peek-list-width)))
320+
(dir-start (string-match-p (f-path-separator) path)))
321+
(if dir-start
322+
(concat "..." (substring path dir-start))
323+
path))
324+
path))
318325
(file-name-nondirectory filename))
319326
'face 'lsp-ui-peek-filename
320327
'file filename

0 commit comments

Comments
 (0)