Skip to content

Commit

Permalink
Fix text align for buffer-face-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
chuxubank authored Mar 18, 2024
1 parent 61dd837 commit 7d32b70
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions sideline.el
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
(defun sideline--align-right (str offset)
"Align sideline STR from the right of the window.
Argument OFFSET is additional calculation from the right alignment."
Argument OFFSET is additional calculation from the right alignment."
(list (+
;; If the sideline text is displayed without at least 1 pixel gap from the right fringe and
;; overflow-newline-into-fringe is not true, emacs will line wrap it.
Expand All @@ -312,11 +312,13 @@
1
0)
(* (window-font-width)
(+ offset (if (display-graphic-p)
;; If right fringe deactivated add 1 offset
(if (= 0 (nth 1 (window-fringes))) 1 0)
1)))
(sideline--string-pixel-width str))))
(+ offset
(if (display-graphic-p)
;; If right fringe deactivated add 1 offset
(if (= 0 (nth 1 (window-fringes))) 1 0)
1)
(length str)))
)))

(defun sideline--get-line ()
"Return current line."
Expand Down

0 comments on commit 7d32b70

Please sign in to comment.