xhcoding / emacs-aichat

AI Chat in Emacs, including OpenAI and Bing Chat
61 stars 9 forks source link

eager code blocks fontification #24

Open untoreh opened 1 year ago

untoreh commented 1 year ago

When the response written includes code blocks, those are only formatted when the end of the block is reached.

```lang
unfontifed code being inserted

It could be improved by tracking triple backtick notations "``lang .... (and maybe also single backtick?) and eagerly append the (org translated) tags to trigger fontification asap, (while still inserting the code block content before the closing tag until the real closing backticks are received from the stream.

```lang
fontified code being inserted
``` <- eager closing tag (org translated)
xhcoding commented 1 year ago

I do not have the time to implement this. PRs are welcome.