Skip to content

Commit

Permalink
fix: Allow truncate pass through
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Nov 23, 2024
1 parent baa38cf commit b329d09
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions sideline.el
Original file line number Diff line number Diff line change
Expand Up @@ -592,16 +592,17 @@ FACE, NAME, ON-LEFT, and ORDER for details."
(pos-start (nth 0 data)) (pos-end (nth 1 data)) (occ-pt (nth 2 data))
(offset (- 0 (sideline--render-data :hscroll)))
;; Truncate
(title (and sideline-truncate
(let* ((win-width (sideline--render-data :win-width))
(used-space (- pos-start occ-pt))
(available-space (- win-width used-space))
(suffix (copy-sequence (truncate-string-ellipsis))))
(set-text-properties 0 (length suffix)
(text-properties-at (1- (length title)) title)
suffix)
(truncate-string-to-width title available-space 0 nil
suffix))))
(title (if sideline-truncate
(let* ((win-width (sideline--render-data :win-width))
(used-space (- pos-start occ-pt))
(available-space (- win-width used-space))
(suffix (copy-sequence (truncate-string-ellipsis))))
(set-text-properties 0 (length suffix)
(text-properties-at (1- (length title)) title)
suffix)
(truncate-string-to-width title available-space 0 nil
suffix))
title))
;; Align left/right
(str (concat
(unless on-left
Expand Down

0 comments on commit b329d09

Please sign in to comment.