Skip to content

Commit

Permalink
fix: Calculate pos-end
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Apr 4, 2024
1 parent d635d14 commit c1729b2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sideline.el
Original file line number Diff line number Diff line change
Expand Up @@ -348,17 +348,15 @@ calculate to the right side."
(let* ((line (sideline--get-line))
(column-start (sideline--window-hscroll))
(pos-first (save-excursion (back-to-indentation) (current-column)))
(pos-end (max (- (sideline--str-len line) column-start)
column-start)))
(pos-end (max (sideline--str-len line) column-start)))
(cond ((<= str-len (- pos-first column-start))
(cons column-start pos-first))
((= pos-first pos-end)
(cons column-start (sideline--window-width)))))
(let* ((line (sideline--get-line))
(column-start (sideline--window-hscroll))
(column-end (+ column-start (sideline--window-width)))
(pos-end (max (- (sideline--str-len line) column-start)
column-start)))
(pos-end (max (sideline--str-len line) column-start)))
(when (<= str-len (- column-end pos-end))
(cons column-end pos-end)))))

Expand Down

0 comments on commit c1729b2

Please sign in to comment.