godbolt.nvim
godbolt.nvim copied to clipboard
[feature request] Autoscroll
Thanks for this plugin and awesome work!
A feature that I'd love with this is autoscroll. For example, as you scroll through your source code, the split that displays the corresponding assembly scrolls with you.
Thanks for your time!
I don't have a clear idea rn, I'll think about this after I implement the TODOs mentioned in the readme
That’s actually a good idea for an extension. TSPlayground works like this, I wonder how they do but typically something similar would be a killer feature.
Shameless plug, but I have impemented a similar feature for my plugin: https://github.com/krady21/compiler-explorer.nvim. It is based on vim.api.nvim_win_set_cursor
.
What do you do when one line of source code corresponds to more than a page of assembly?
I always set the cursor to the first line from the corresponding assembly output. I also thought about setting the cursor to the line exactly in the middle of the assembly output, but ended up going with the first option.
@krady21 then if the user jumps to the assembly window to scroll (because it doesn't fit etc) and then jumps back to the source window, it will count as a CursorMoved
and the assembly window will scroll back up again right?
This is a hard problem, I think this is why godbolt.org doesn't do it either
I'm closing this as it seems impossible to solve due to the window-jumping issue mentioned in the previous comment - I tried out compiler-explorer.nvim which has the same issue