File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -118,14 +118,13 @@ This pre-pends the path to the buffer if so configured."
118
118
119
119
(defun whale-line-segments--buffer-identification--path-segments ()
120
120
" Get preceding path segments."
121
- (when (> whale-line-segments-buffer-identification-path-segments 0 )
121
+ (and-let* (((> whale-line-segments-buffer-identification-path-segments 0 ))
122
+ (file (buffer-file-name (current-buffer )))
123
+ (path (file-name-split file))
124
+ (count (min (1- (length path)) whale-line-segments-buffer-identification-path-segments))
125
+ (segments (seq-take (cdr (reverse path)) count)))
122
126
123
- (let* ((file (buffer-file-name (current-buffer )))
124
- (path (file-name-split file))
125
- (count (min (1- (length path)) whale-line-segments-buffer-identification-path-segments))
126
- (segments (seq-take (cdr (reverse path)) count)))
127
-
128
- (concat (string-join (reverse segments) " /" ) " /" ))))
127
+ (concat (string-join (reverse segments) " /" ) " /" )))
129
128
130
129
(whale-line-create-stateful-segment buffer-identification
131
130
:getter whale-line-segments--buffer-identification
You can’t perform that action at this time.
0 commit comments