Split pane down: bottom pane does not maintain scroll position previously shown

edit by @rsese to add more specific repro steps and expected behavior

Using https://github.com/atom/atom/blob/be8097272f40a069c08e8879a49de72223fd03b2/src/pane.js:

  1. Open src/pane.js in atom/atom
  2. Scroll down so that the last line of the findOrCreateBottommostSibling() function is the last visible line, line 1208.
  3. Click on line 1185
  4. Right-click and Split Down

Expected behavior:

code on the top and bottom halves of the screen are pretty much the same as before choosing Split Panes.

So line 1208 will still be the last visible line of the bottom pane.

But actual behavior is that the top most lines in both panes match (so line 1208 isn’t the last visible line in the bottom pane).

Also:

The actual current behavior is slightly worse than described, in that the bottom pane shifts so that the first visible line (1164) doesn’t even match what’s visible above (1164 is not visible in practice; only a few non-interpretable pixels of it are shown). This makes the split even more disorienting / harder to get reoriented.
Whatever fraction of line 1209 (the last visible line) is visible before the split, I expect to see the same fraction of the same line in the same place after.


Prerequisites

Description

When splitting the pane Down, the scroll bar for the new pane is set so that the new top matches the old top of the viewport, instead of the new bottom matching the old bottom.

Steps to Reproduce

Open a reasonably long code file, viewing it in a single pane top to bottom. The code contains many short, modular functions.
Recognize you would like to view two on the screen at the same time, that are not next to each other in the file.
Align the file so the bottom one is correct, planning to split the view and scroll the top to the reference point for reading while developing down below.
Right-click around the middle and choose Split Down.
Screencast demo

Expected behavior:
There is a new pane division running horizontally across the center of the screen, and possibly obscuring a few lines of code in the middle, but code on the top and bottom halves of the screen are pretty much the same as before choosing Split Panes.

Actual behavior:
The bottom pane is scrolled so that the top is at the top of whatever line the upper pane started in. Whatever was previously shown on the bottom half of the screen is now scrolled out of view.

Reproduces how often:
Very reliably, even in safe mode.

Versions

Atom : 1.23.2
Electron: 1.6.15
Chrome : 56.0.2924.87
Node : 7.4.0
Windows: 10 Pro

1 possible answer(s) on “Split pane down: bottom pane does not maintain scroll position previously shown

  1. I double checked with the team and this split behavior is intentional and not something the team would change at this point so we’re going to close this out.

    If there are other editors that behave as expected, and Atom makes a deliberate choice not to, I’d like to find out what those others are and switch. (Exception: MS Word, which does behave like that, doesn’t count as a text editor for code).

    Sorry if this is deal breaker for you – I don’t know of an editor that behaves the way you expect off the top of my head (I tried VS Code as well just now and it seems to split similarly) so can’t offer any suggestions myself.