It suprises me that this bug (seems to) exists since 18 YEARS! It's the pendant of https://sourceforge.net/p/scintilla/bugs/535/ . Does nobody uses the STUTTEREDPAGE commands?
I found it in Notepad++ and will therefore explain how you can reproduce the bug in Notepad++.
The problem is, that SCI_STUTTEREDPAGEUP does not scroll up when a folded block would come into view.
Steps to reproduce:
Behavior:
On first execution, it goes to the top line, as expected.
On second execution, the view should've scrolled up, but in practice nothing happens.
In the notepad++ repository the function that contains the bug is likely:
https://github.com/notepad-plus-plus/notepad-plus-plus/blob/d6bdc5d3f8bea4cf7cfc83e5c243107770fa22cb/scintilla/src/Editor.cxx#L2998
Version Details: Notepad++ v8.7; uses Scintilla v5.3.5
I personally never use the STUTTEREDPAGE commands (and didn't implement them) so this will require someone else to contribute a fix.