agda-mode-vscode
agda-mode-vscode copied to clipboard
Scroll down in the Agda Debug Buffer panel
Hello, I've been enjoying this extension quite a bit, thanks for the work!
Recently I started using the debug buffer panel, to view the contents of the debug buffer. I think a nice improvement would be to have the panel automatically scroll to the bottom when a new message is appended. I tried to get this to work myself, but I did not manage it in ReScript.
A quick implementation would be to add code that scrolls down all the way in Panel.res, above the linked line. This would scroll down when any message is appended. I'm not sure if that's a good long-term solution, but it'd work for now.
The JS/TS code would be
window.scrollTo({
top: document.documentElement.scrollHeight,
behavior: useSmoothScrolling ? 'smooth' : 'auto',
});
where useSmoothScrolling would be the value indicating whether smooth scrolling is enabled (editor.smoothScrolling). behavior could also just be set to 'auto' if that's easier.
Thanks for the feedback!
I added that debug buffer a while ago because my colleagues needed it for hacking Agda. Looks like you are doing something interesting, too 👀