turboderp / exllamav2

A fast inference library for running LLMs locally on modern consumer-class GPUs
MIT License
3.28k stars 243 forks source link

Fixed code block syntax highlighting for long code #191

Closed SinanAkkoyun closed 7 months ago

SinanAkkoyun commented 7 months ago

When very long codeblocks are being printed, the ANSI clear line code can not clear the whole code to reprint, because it is outside of the terminal window.

Before, the codeblock repeated it's top lines as they were not cleared but still printed.

As a fix, only clear termheight-1 lines, the remaining top line should automatically stay in buffer.

(The PR works but the top line somehow messes up the front padding, I am working on that rn)

SinanAkkoyun commented 7 months ago

The padding now also works, the code is done