From de5be3e5ffee2e6d5bcf8e071a5c6a180d9500ed Mon Sep 17 00:00:00 2001 From: "Guido A.J. Stevens" Date: Wed, 17 Jan 2024 11:04:32 +0100 Subject: [PATCH] Add documentation, refs #205 --- README.md | 17 +++++++++++++++++ company-box.el | 1 + 2 files changed, 18 insertions(+) diff --git a/README.md b/README.md index 65b0113..2684fa4 100644 --- a/README.md +++ b/README.md @@ -50,3 +50,20 @@ Notes: By default, images are used to display icons. You can also use [font icons](https://github.com/sebastiencs/company-box/wiki/icons) With images, you can't change icons colors + +### Top margin + +You can position the frame downwards by setting the variable `company-box-frame-top-margin` to a positive number. This is useful if your base code/text has an enlarged line height, and company box is intruding into the line above. It's also useful, if you're using copilot and want to see a few lines of suggested code unobscured by the company box. See [PR #205](https://github.com/sebastiencs/company-box/pull/205) for details. + +You can set the top margin mode-dependent via mode hooks, if you want. E.g. in Doom Emacs: + +``` el +(use-package! company-box + :defer t + :config + (setq-hook! 'prog-mode-hook + company-box-frame-top-margin 20) + (setq-hook! 'text-mode-hook + company-box-frame-top-margin 75) +) +``` diff --git a/company-box.el b/company-box.el index fb8d991..995fe06 100644 --- a/company-box.el +++ b/company-box.el @@ -204,6 +204,7 @@ character (see `frame-char-width'), set `0.5' to get half width of a character." (defcustom company-box-frame-top-margin 0 "Set extra space above the top of the frame, in pixels. +This is useful if the company box intrudes on the code/text above it For example, set '70' if you're using copilot, to make sure the frame doesn't overlap with the first lines of copilot suggestions." :type 'number