diff --git a/core/siren-core-modules.el b/core/siren-core-modules.el index 317c5bb..d851aad 100644 --- a/core/siren-core-modules.el +++ b/core/siren-core-modules.el @@ -27,6 +27,7 @@ (require 'siren-cape) (require 'siren-company) (require 'siren-copilot) +(require 'siren-marginalia) ;; Documentation (require 'siren-dash-at-point) @@ -38,7 +39,6 @@ (require 'siren-display-indentation) (require 'siren-display-line-numbers) (require 'siren-embark) -(require 'siren-marginalia) (require 'siren-minions) (require 'siren-mwim) (require 'siren-origami) diff --git a/modules/editor/siren-marginalia.el b/modules/completion/siren-marginalia.el similarity index 91% rename from modules/editor/siren-marginalia.el rename to modules/completion/siren-marginalia.el index b5cfd40..dc72c27 100644 --- a/modules/editor/siren-marginalia.el +++ b/modules/completion/siren-marginalia.el @@ -63,11 +63,15 @@ mode." :face 'marginalia-file-name)))) (defun marginalia--project-buffer-file (buffer) - "Return the file or process name of BUFFER relative to project root, if it -is within project root." - (let ((root (marginalia--project-root)) - (file (marginalia--buffer-file buffer))) - (if (string-equal root file) file + "Return the file or process name of BUFFER relative to project root." + (let* ((root (expand-file-name (marginalia--project-root))) + (raw-file (marginalia--buffer-file buffer)) + (file (if (string-prefix-p "~/" raw-file) + (expand-file-name raw-file) + raw-file))) + (if (or (string-empty-p root) + (string-equal root file)) + raw-file (string-remove-prefix root file)))) :config