How to make VSCode editor stop scrolling past bottom of a file?
WindowsMacosVisual Studio-CodeEditorWindows Problem Overview
In the VSCode editor when you pull the scroll bar down to the bottom of the file, all you see is a blank page, since the text has scrolled up past the top of the text editor window. This makes scrolling to the bottom difficult because you can't just pull the scroll bar quickly all the way down but have to carefully position the cursor so you can still see your code.
Very similar to https://stackoverflow.com/questions/1747282/how-to-make-visual-studio-editor-stop-scrolling-past-bottom-of-a-file, but comments have pointed out that question/answer is for Visual Studio. This answer is for VSCode on the macOS and Windows.
Windows Solutions
Solution 1 - Windows
The correct answer is seen here: https://stackoverflow.com/a/40588828/1189470
>There is a configuration option provided in VSCode for the functionality you specified. To enable it, go to File -> Preferences -> user settings
>
>On the right side of the editor in settings.json paste the below line at the bottom (before closing bracket), save and close.
>
> "editor.scrollBeyondLastLine": false
>
>This will prevent the editor from scrolling beyond the last line.
Solution 2 - Windows
This is now exposed as a simple checkbox labeled "Editor: Scroll Beyond Last Line" in File/Apple -> Preferences.
Solution 3 - Windows
If just for readability you would like some space at the bottom of the file - a configurable amount - try this setting as of v1.43:
editor.padding.bottom
in pixels
> Editor> Padding: Bottom > > Controls the amount of space between the bottom edge of the editor and > the last line.
and/or
editor.padding.top
// but this isn't sticky in the sense that you can scroll right past the padding top and it is gone. It doesn't stay.