Skip to content

Commit

Permalink
Add documentation, refs #205
Browse files Browse the repository at this point in the history
  • Loading branch information
gyst committed Jan 17, 2024
1 parent f5aa1d4 commit de5be3e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
```
1 change: 1 addition & 0 deletions company-box.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit de5be3e

Please sign in to comment.