continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
16.14k stars 1.25k forks source link

code block font should use editor.fontFamily by default #797

Closed yuuuxt closed 7 months ago

yuuuxt commented 7 months ago

Before submitting your bug report

Relevant environment info

- OS: win10 x64
- Continue: v.0.8.6
- IDE: vscode

Description

currently the code block looks like this (the font is a default font, not what I'm using in vscode): 图片 which applies this css: 图片

so it uses --monaco-monospace-font as the default font. I think the best default setting should be editor.fontFamily, i.e. --vscode-editor-font-family.

(I tried to search --monaco-monospace-font in this repo but didn't find a match)

To reproduce

  1. use arbitrary model to generate some chat that contains a code block
  2. check the css (and try to modify it as described)

Log output

(NA)
sestinj commented 7 months ago

@yuuuxt Looks really nice after doing this, thanks for taking the time to find the variable! It'll be in the next release today

sestinj commented 7 months ago

@yuuuxt ready now in the main release and pre-release. Thanks again for the suggestion, as it also forced me to download the FiraCode font for the first time...enjoying the ligatures so far!

yuuuxt commented 7 months ago

Feels it can also be applied here (inline <code>): 图片 图片 图片

seems it's an easy task so I tried to create a PR here: https://github.com/continuedev/continue/pull/805

yuuuxt commented 7 months ago

Also, I want the chat font to be var(--vscode-font-family), so that it is consistent with the UI of vscode. What do you think?

图片

https://github.com/continuedev/continue/blob/e1291969278597febdf0cce7ce3c9e70fe9dbe95/gui/src/components/markdown/StyledMarkdownPreview.tsx#L62

(created a PR here: https://github.com/continuedev/continue/pull/808)