Thank you flycheck
This commit is contained in:
parent
4925bca107
commit
c2524b420e
@ -7,6 +7,8 @@
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'face-remap)
|
||||
|
||||
(defvar-local center-content--horizontal-overlay nil
|
||||
"Overlay used to add left margin for horizontal centering.")
|
||||
|
||||
@ -20,16 +22,17 @@
|
||||
"Cookie for the face remapping of `header-line`.")
|
||||
|
||||
(defun center-content--content-pixel-size ()
|
||||
"Return the size of the content of the visible text in pixels."
|
||||
(window-text-pixel-size (selected-window) (window-start) (window-end)))
|
||||
|
||||
(defun center-content--calculate-left-margin (content-width)
|
||||
"Calculate the left margin needed to center the content horizontally."
|
||||
"Calculate the left margin relative to CONTENT-WIDTH."
|
||||
(let ((window-width (window-pixel-width))
|
||||
(column-width (string-pixel-width " ")))
|
||||
(/ (max 0 (- window-width content-width)) (* 2 column-width))))
|
||||
|
||||
(defun center-content--calculate-top-margin (content-height)
|
||||
"Calculate the top margin needed to center the content vertically."
|
||||
"Calculate the top margin relative to CONTENT-HEIGHT."
|
||||
(let ((window-height (window-pixel-height))
|
||||
(line-height (default-line-height)))
|
||||
(/ (max 0 (- window-height content-height)) (* 2 line-height))))
|
||||
|
Loading…
Reference in New Issue
Block a user