I can see how that would be annoying. I can also see why the developers might not have noticed. When I'm in Emacs, I tend to navigate using the keyboard, which means I scroll by moving the cursor and dragging the viewport with it.
So they probably added the ability to scroll without moving the cursor so Emacs would have the feature. But if they never really used it, they wouldn't have noticed the shortcomings in their implementation.
Sorry for the rambling, not sure if I really had a point to make ;)
When using Emacs, my workflow was very keyboard-centric, but sometimes navigation was a pain (even with tags and whatnot).
> But I would love to go back to it, to be honest.
What helps me not get bogged down in versioning, is to let someone else deal with it.
For example, Debian and NixOS each package many Emacs packages. I just use their versions, and treat it like any other piece of software managed by the OS.
Alternatively you could try things like Doom, which I think handles versioning.
(setq scroll-preserve-screen-position 1)
What scroll-preserve-screen-position determines, is whether the point/cursor stays at the same visual position in the screen — i.e. if for instance your cursor was in the middle of the screen, it will stay in the middle when you scroll.
OP needs the currently non-existent scroll-preserve-buffer-position.
Some heuristics to make it fully behave. Multiple scroll events should not modify mark, for example. Mouse click does not jump back to mark. Etc.
I can't believe I didn't think of this. I'm already using marks to keep track of position when I scroll, it's just all manual right now.
I'll likely mess around with some hooks in my config this weekend and see if this is actually feasible, or if it comes with caveats I'm not seeing right now. I guess it would need to account for multiple windows open into the same buffer too.
> and the solution was something like "you are using it wrong - you need to use marks instead".
I was also extremely bothered by the fact that the cursor cannot live outside the current viewport and scrolling the buffer would drag the cursor as well. At the time, it seemed impossible to fix because of the way Emacs works, and the solution was something like "you are using it wrong - you need to use marks instead".
But I would love to go back to it, to be honest. VSCode is very good, but Emacs is a whole other level of automation and convenience.