Skip to content

Commit

Permalink
Fix relative file display in tramp context
Browse files Browse the repository at this point in the history
Problem is in dape--guess-root which cant decide if it is going to
return emacs file paths or adapter file paths (with or without tramp).
  • Loading branch information
svaante committed Jan 15, 2024
1 parent f8db03f commit b9d0579
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dape.el
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,8 @@ If PULSE pulse on after opening file."
"Guess adapter path root from CONFIG."
;; FIXME We need some property on the adapter telling us how it
;; decided on root
;; FIXME Is this function meant to return root emacs world (with tramp)
;; or adapter world w/o tramp?
(let ((cwd (plist-get config :cwd))
(command-cwd (plist-get config 'command-cwd)))
(cond
Expand Down Expand Up @@ -864,7 +866,10 @@ If EXTENDED end of line is after newline."
(or (and-let* ((parent (dape--parent conn)))
(dape--config parent))
(dape--config conn))))
(root-guess (dape--guess-root config)))
(root-guess (dape--guess-root config))
;; Normalize paths for `file-relative-name'
(file (tramp-file-local-name file))
(root-guess (tramp-file-local-name root-guess)))
(concat
(string-truncate-left (file-relative-name file root-guess)
dape-info-file-name-max)
Expand Down

0 comments on commit b9d0579

Please sign in to comment.