Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure child frame position #62

Open
gjm opened this issue Jun 16, 2023 · 2 comments
Open

Configure child frame position #62

gjm opened this issue Jun 16, 2023 · 2 comments

Comments

@gjm
Copy link

gjm commented Jun 16, 2023

I have set up a bigger line height because I like my code to breathe.

(setq-local default-text-properties '(line-spacing 0.50 line-height 1.50))

With this config the child frame overlaps the current line:

Screenshot from 2023-06-16 15-00-10

Is there a way to configure the child frame position?

@tumashu
Copy link
Owner

tumashu commented Jun 19, 2023

you can try to hack the below function

(defun company-posframe-show-at-prefix (info)
  "Poshandler showing `company-posframe' at `company-prefix'."
  (let* ((parent-window (plist-get info :parent-window))
         (point (with-current-buffer (window-buffer parent-window)
                  (- (plist-get info :position)
                     (plist-get info :company-prefix-length))))
         (posn (posn-at-point point parent-window))
         ;; TODO: Strictly speaking, if company-posframe-font is not nil, that
         ;; should be used to find the default width...
         (expected-margin-width (* (plist-get info :company-margin) (default-font-width)))
         (xy (posn-x-y posn)))
    (setcar xy (- (car xy) expected-margin-width))
    (posframe-poshandler-point-bottom-left-corner (plist-put info :position posn))))

@gjm
Copy link
Author

gjm commented Jun 19, 2023

My Emacs Lisp fu is awful! I wouldn't know where to begin...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants