Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#354 Selecting element in Structure view to scroll to top of text input screen

None
closed
nobody
None
1
2012-11-22
2012-11-08
Alex Koudrin
No

This is from the (now closed) bug #626 that I raised:

I have noticed in the last several revisions of TexStudio (this is the latest, 2.5) that when you select an element in the Structure/Tree view the text view does not always scroll to have that element at the top of the page. More specifically when going from the top down, the elements would be displayed at the bottom. It's fine when going bottom up. I think this is because it is implemented by just having the cursor jump to that line like search.

What needs to be done is the cursor should jump to the required line selected in the Structure view, but also have the screen scroll down so that the cursor (at the line of the element selected) is always the verfy first line of the Text screen.

It seems to be fixed to the extent that the text view will shot +/-5 lines, but it would be better to see more of the actual section content below. Perhaps having 5 lines above the section and the rest of the screen showing the selected section might work better? Could do just the section at the very top. I'm not certain which will work better in reality - for the implementer to decide :)

Thanks, Alex

Discussion

  • Tim Hoffmann
    Tim Hoffmann
    2012-11-08

    The basic idea behind this behavior is that, you do not scroll the screen for small changes. If you are on line 8 and jump to line 10 it's easier to recognize that you are approximately at the same position if the editor is not scrolled to starting on line 5. Or at least only as little as possible. The limit to a +/- lines surrounding gives us the freedom to scroll not at all or only litte in some cases.

    Of course this concept of moving as little as possible isn't very reasonable when you jump up larger parts of the document.

    So I'd propose the following: We keep the surrounding limits. Additionally, if the target position is off screen we move it to the top + 5 lines. This combines the advantage of lazy scrolling for small jumps with the wish to see more of the document for larger jumps.

     
  • Tim Hoffmann
    Tim Hoffmann
    2012-11-22

    suggested behavior implemented in rev. 3491

    • status: open --> closed
    • milestone: -->
     
    Last edit: Tim Hoffmann 2012-11-22