Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#236 pre15: relative position of cursor is lost after restart

v5.2
closed-out-of-date
nobody
None
5
2014-03-24
2008-08-18
goebbe
No

I am using jedit4.3pre15 with Sun JavaRE 1.6.0_07 on WinXP SP2.
Compared with jedit4.3pre14 I discovered the following regression:
The relative position of the cursor within an open buffer (sreen) is not restored when exiting and restarting Jedit. Instead it seems that after a restart the last position of the cursor is now shown in the first line of the screen. (if there are enough lines after the last cursor position to move the document up)

Expected behaviour:
Wherever the cursor is and however I have scrolled the document - the screen-view (last position of cursor and scroll-position) should be recovered after a restart of Jedit. (as in jedit4.3pre14 and before)

To reproduce:
1) open a document with many lines.
2) scroll down (a bit) the document
3) place the cursor somewhere in the middle of the buffer view
4) remember how the screen looks like
5) exit and restart Jedit
6) discover that the cursor ("active line") is now at the top of the screen.

Actually when there are only view lines at the end of the document that are not shown, then the cursor (active line) ends up somewhere between the last relative position and the top of the screen (first line of the buffer-view). In this case the position after restart is close to unpredictable, since it will neither be the first line on screen nor will it be the last position on the screen.

I think the new behaviour is confusing, since it leads to unpredictable results for the position of the active line, after a restart.
Moreover I think that orientation is easier when the old position is kept.

Sorry, I don't know the proper names of the different components. Hopefully this is helpful anyway. Please don't hesitate to ask for more information.

Keep up the good work!

Discussion

  • I have also been confused many times on this new behavior.

    I seek in the source how the scroll position was restored at 4.3pre14,
    but nothing found. Then I re-examined the old and new behaviors.

    I realized that the old behavior was not restoring the scroll position,
    but centering the caret with restored caret position.

    But still couldn't find why the behavior was changed.

     
  • goebbe
    goebbe
    2008-12-09

    I just tested if the bug is still present in Jedit 4.3pre16 and I confirm that
    that the bug is still present.
    The last scroll position is not restored after a restart.

     
  • goebbe
    goebbe
    2009-07-07

    I realise that "session" is still not restored correctly in 4.3pre17.
    Also when there are two buffers open with a vertical split view and the cursor is in the right buffer then after restarting Jedit the cursor is at the top of the left buffer.

    Ideally, exactly the same buffer (scroll) position and cursor (caret) position should be recreated after a restart of Jedit as it used to be before the restart.

     
  • Alan Ezust
    Alan Ezust
    2009-07-07

    • assigned_to: nobody --> shlomy
     
  • Setting this to a feature request. It's not a bug in the sense that jEdit was never meant to restore the scroll position, only the caret position in the buffer. The scroll position is not saved at all.

     
  • Alan Ezust
    Alan Ezust
    2009-12-03

    Currently, it should already restore the caret position, and the caret should be visible, preferably centered, or perhaps at the top of the file if that's where the caret was on exit.
    If the caret position is not correctly restored, that is still a bug. Please open it as a separate ticket.
    For example if you can make a test case that demonstrates this with split-views.

    But for the scrollbar positions to be restored, that requires change in the perspective.xml file format.

     
    • assigned_to: shlomy --> nobody
     
  • Alan Ezust
    Alan Ezust
    2014-03-24

    • status: open --> closed-out-of-date
    • Group: --> v5.2