Vscode: "Halfway" option for scrolling beyond the last line

Created on 11 Aug 2018  路  11Comments  路  Source: microsoft/vscode

Currently, VSCode has two options for scrolling past the last line of the file (editor.scrollBeyondLastLine): either it's enabled, in which case you can scroll the full window height beyond the last line, or disabled, in which case the farthest you can scroll is so that the last line of the file is at the very bottom of the window.

Both of these settings have issues. If the setting is enabled, then when you scroll as far as possible, you'll just be looking at a blank window because only the last line of the file is visible (at the very top of the screen). If the setting is disabled, then when you scroll as far as possible, the last line of the file is at the very bottom, which can be awkward -- generally I like the cursor to be near the middle of the screen, and if I'm editing the last line of the file then that's not possible.

Ideally, VSCode would have a "halfway" option for this setting, where the farthest you could scroll beyond the last line of the file would be half the window height. This way, when you scroll down as far as possible, the last line will be vertically centered in the editor window.

editor-rendering feature-request

Most helpful comment

You can add this to the settings.json file as a workaround:
"editor.padding.bottom": 100,

All 11 comments

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

I would +1 this, and also consider both sides of the scroll feature. That is, the scroll would go beyond the end or the beginning of the file, until the line where the cursor is located lies in a middle position with respect to the editor pane. This makes sense when one is editing in a display in vertical (portrait) position.

I think this is a good idea. Maybe there is an extension that does it already? Sadly, I can't find a good one.

There is an extension, named "scrolloff", that may help you. If you activate "scrolloff.alwaysCenter" and "Scroll Beyond Last Line", you can use the Arrow keys to scroll down and the scroll will stop when the cursor is at the middle of the screen.
However:

  • This does not work when scrolling using the scroll wheel
  • You can't move the cursor without scrolling anymore

I don't use it (because of the disadvantages), but I hope it may be helpful to someone passing by.

There is an extension, named "scrolloff", that may help you.

Note that there's a feature request for implementing that option natively: #12048.

Wouldn't think also fix #47879?

Well, the extension I was talking about, "scrolloff", could possibly fix #47879, but I don't think fixing this current issue would fix #47879.

If the setting acted like @JavierReyes945 suggested it would essentially be "typewriter" scrolling, always keeping the line you're editing in the center of the editor pane vertically

This is similar to #85268 as well.

You can add this to the settings.json file as a workaround:
"editor.padding.bottom": 100,

You can add this to the settings.json file as a workaround:
"editor.padding.bottom": 100,

Actually "editor.padding.top": 100, is almost exactly what I'm looking for! However, it would be better for the document to also initially display at the normal position when opened and also allow the scrolling past line 1 as this does. Maybe it's not so ban and just different I'll get used to it or like it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

philipgiuliani picture philipgiuliani  路  3Comments

VitorLuizC picture VitorLuizC  路  3Comments

biij5698 picture biij5698  路  3Comments

chrisdias picture chrisdias  路  3Comments

trstringer picture trstringer  路  3Comments