Skip to content

Commit

Permalink
Fix truncate lines
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Mar 2, 2022
1 parent 9e1a517 commit dd966bb
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions auto-scroll-bar.el
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,18 @@

(defun auto-scroll-bar--show-h-p ()
"Return non-nil if we should show the horizontal scroll-bar."
(when horizontal-scroll-bar
(save-excursion
(move-to-window-line 0)
(let ((count 0) (target (auto-scroll-bar--window-height)) break)
(while (and (not (eobp)) (< count target) (not break))
(if (< (auto-scroll-bar--window-width) (- (line-end-position) (line-beginning-position)))
(setq break t)
(forward-line 1)
(cl-incf count)))
break))))
(and
horizontal-scroll-bar
truncate-lines
(save-excursion
(move-to-window-line 0)
(let ((count 0) (target (auto-scroll-bar--window-height)) break)
(while (and (not (eobp)) (< count target) (not break))
(if (< (auto-scroll-bar--window-width) (- (line-end-position) (line-beginning-position)))
(setq break t)
(forward-line 1)
(cl-incf count)))
break))))

(defun auto-scroll-bar--disabled-p ()
"Return non-nil if scroll-bars should be ignored."
Expand Down

0 comments on commit dd966bb

Please sign in to comment.