File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -365,6 +365,17 @@ Tables are marked to be ignored by line wrap."
365
365
(cider-docview-format-tables buffer) ; may contain literals, emphasis
366
366
(cider-docview-wrap-text buffer))))) ; ignores code, table blocks
367
367
368
+ (defun cider--abbreviate-file-protocol (file-with-protocol )
369
+ " Abbreviate the file-path in `file:/path/to/file' ."
370
+ (if (string-match " \\ `file:\\ (.*\\ )" file-with-protocol)
371
+ (let ((file (match-string 1 file-with-protocol))
372
+ (proj-dir (clojure-project-dir)))
373
+ (if (and proj-dir
374
+ (file-in-directory-p file proj-dir))
375
+ (file-relative-name file proj-dir)
376
+ file))
377
+ file-with-protocol))
378
+
368
379
(defun cider-docview-render-info (buffer info )
369
380
" Emit into BUFFER formatted INFO for the Clojure or Java symbol."
370
381
(let* ((ns (nrepl-dict-get info " ns" ))
@@ -449,7 +460,7 @@ Tables are marked to be ignored by line wrap."
449
460
(insert (propertize (if class java-name clj-name)
450
461
'font-lock-face 'font-lock-function-name-face )
451
462
" is defined in " )
452
- (insert-text-button cider-docview-file
463
+ (insert-text-button ( cider--abbreviate-file-protocol cider- docview-file)
453
464
'follow-link t
454
465
'action (lambda (_x )
455
466
(cider-docview-source)))
You can’t perform that action at this time.
0 commit comments