Workaround childframe sizing issue (issue#68)
* eldoc-box.el (eldoc-box--update-childframe-geometry): Set frame size to something very small before calculating the text size.
This commit is contained in:
parent
90deae21cc
commit
4066df5a29
11
eldoc-box.el
11
eldoc-box.el
@ -376,6 +376,17 @@ base on WIDTH and HEIGHT of childframe text window."
|
|||||||
(defun eldoc-box--update-childframe-geometry (frame window)
|
(defun eldoc-box--update-childframe-geometry (frame window)
|
||||||
"Update the size and the position of childframe.
|
"Update the size and the position of childframe.
|
||||||
FRAME is the childframe, WINDOW is the primary window."
|
FRAME is the childframe, WINDOW is the primary window."
|
||||||
|
;; WORKAROUND: See issue#68. If there’s some text with a display
|
||||||
|
;; property of (space :width text) -- which is what we apply onto
|
||||||
|
;; markdown separators -- ‘window-text-pixel-size’ wouldn’t return
|
||||||
|
;; the correct value. Instead, it returns the current window width.
|
||||||
|
;; So now the childram only grows in size and never shrinks. For
|
||||||
|
;; whatever reason, if we set the frame size very small before
|
||||||
|
;; calculating window’s text size, it can return the right value.
|
||||||
|
;; (My guess is that the function takes (space :width text) at face
|
||||||
|
;; value, but that can’t be the whole picture because it works fine
|
||||||
|
;; when I manually evaluate the function in the childframe...)
|
||||||
|
(set-frame-size frame 1 1 t)
|
||||||
(let* ((size
|
(let* ((size
|
||||||
(window-text-pixel-size
|
(window-text-pixel-size
|
||||||
window nil nil
|
window nil nil
|
||||||
|
Loading…
Reference in New Issue
Block a user