File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 66
66
:type 'string
67
67
:group 'go-guru )
68
68
69
+ (defcustom go-guru-truncate-file-length 20
70
+ " The length to truncate the file name to in the output buffer."
71
+ :type 'integer
72
+ :group 'go-guru )
73
+
69
74
(defvar go-guru--scope-history
70
75
nil
71
76
" History of values supplied to `go-guru-set-scope' ." )
@@ -231,9 +236,10 @@ output of the Go guru tool."
231
236
(setq p (1- p)) ; exclude final space
232
237
(let* ((posn (buffer-substring-no-properties start p))
233
238
(flen (cl-search " :" posn)) ; length of filename
234
- (filename (if (< flen 19 )
239
+ (truncate (- (max go-guru-truncate-file-length 20 ) 1 ))
240
+ (filename (if (< flen truncate)
235
241
(substring posn 0 flen)
236
- (concat " …" (substring posn (- flen 19 ) flen)))))
242
+ (concat " …" (substring posn (- flen truncate ) flen)))))
237
243
(put-text-property start p 'display filename)
238
244
(forward-line 1 )
239
245
(setq start (point ))))))))
You can’t perform that action at this time.
0 commit comments