Menu

#781 Jumping to a large entry makes it appear at the bottom of the editor

3.6
closed-fixed
None
5
2016-03-09
2015-11-05
No

I noticed that when jumping to an entry (by clicking on a search result, for example) containing a lot of text surrounded by other large entries, the current segment is always at the bottom of the window, forcing me to scroll down to see it completely.

I suspect the problem lies in org.omegat.gui.editor.EditorController.scrollForDisplayNearestSegments(CaretPosition) but I could not really fix the issue properly.

Discussion

  • Didier Briel

    Didier Briel - 2015-11-06
    • Group: 2.6 --> 3.5
     
  • Briac Pilpré

    Briac Pilpré - 2015-11-11

    I made a fix that works for my personal use, however I'm not sure it is OK for all the use cases. My fix just goes to the previous segment before scrolling to the current one instead of scrolling to -3/+4/current.

     
  • Aaron Madlon-Kay

    I'm trying your patch on a project that has mostly single-line segments. When entering a segment off the bottom of the screen, it only scrolls just enough to show that segment. It feels a bit uncomfortable. I definitely prefer the existing behavior in this case.

    I think the intent of the lookahead/lookbehind is to ensure that context is visible. A general solution probably requires different behavior depending on the size of the segments relative to the viewport. A static number of segments is going to give bad results in some cases, but have you tried -1/+1?

     
  • Aaron Madlon-Kay

    The scrolling logic was a bit of a mess so I cleaned it up in trunk (r8049). It seems there is no reason for the lookbehind/lookahead other than it being an attempt to vertically center the current segment, so I have implemented such centering properly.

     
  • Aaron Madlon-Kay

    • assigned_to: Aaron Madlon-Kay
    • Group: 3.5 --> 3.6
     
  • Aaron Madlon-Kay

    • status: open --> open-fixed
     
  • Aaron Madlon-Kay

    I'm calling this fixed. Please reopen if necessary.

     
  • Didier Briel

    Didier Briel - 2016-03-09
    • status: open-fixed --> closed-fixed
     
  • Didier Briel

    Didier Briel - 2016-03-09

    Closed in the released version 3.6.0 of OmegaT.

    Didier

     

Log in to post a comment.