Skip to content

Commit

Permalink
Keep suffix if file path exceeds peek list width
Browse files Browse the repository at this point in the history
  • Loading branch information
nenorbot committed Jan 18, 2023
1 parent 295d898 commit 543e712
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lsp-ui-peek.el
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,14 @@ XREFS is a list of references/definitions."
(len-str (number-to-string count)))
(setq lsp-ui-peek--size-list (+ lsp-ui-peek--size-list count))
(push (concat (propertize (if lsp-ui-peek-show-directory
(lsp-ui--workspace-path filename)
(let ((path (lsp-ui--workspace-path filename)))
(if (> (length path) lsp-ui-peek-list-width)
(let* ((path (substring path (- (length path) lsp-ui-peek-list-width)))
(dir-start (string-match-p (f-path-separator) path)))
(if dir-start
(concat "..." (substring path dir-start))
path))
path))
(file-name-nondirectory filename))
'face 'lsp-ui-peek-filename
'file filename
Expand Down

0 comments on commit 543e712

Please sign in to comment.