Skip to content

Commit

Permalink
[Vcs] fix display transient posframe height
Browse files Browse the repository at this point in the history
  • Loading branch information
luiznux committed Mar 7, 2024
1 parent 32d0563 commit 99f4e02
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lisp/code/init-vcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,26 @@
(right-fringe . 8)))
:config
(with-no-warnings
;; FIXME:https://github.com/yanghaoxie/transient-posframe/issues/5#issuecomment-1974871665
(defun my-transient-posframe--show-buffer (buffer _alist)
"Show BUFFER in posframe and we do not use _ALIST at this period."
(when (posframe-workable-p)
(let* ((posframe
(posframe-show buffer
:height (with-current-buffer buffer (1- (count-screen-lines (point-min) (point-max))))
:font transient-posframe-font
:position (point)
:poshandler transient-posframe-poshandler
:background-color (face-attribute 'transient-posframe :background nil t)
:foreground-color (face-attribute 'transient-posframe :foreground nil t)
:min-width transient-posframe-min-width
:min-height transient-posframe-min-height
:internal-border-width transient-posframe-border-width
:internal-border-color (face-attribute 'transient-posframe-border :background nil t)
:override-parameters transient-posframe-parameters)))
(frame-selected-window posframe))))
(advice-add #'transient-posframe--show-buffer :override #'my-transient-posframe--show-buffer)

(defun my-transient-posframe--hide ()
"Hide transient posframe."
(posframe-hide transient--buffer-name))
Expand Down

0 comments on commit 99f4e02

Please sign in to comment.