Fix scrolling

The logic for choosing the visible preview pane wasn't always working.