tigrawap / slit

slit - a modern PAGER for viewing logs, get more than most in less time
Other
469 stars 18 forks source link

Don't scroll horizontally more than the longest line #54

Open notramo opened 6 years ago

notramo commented 6 years ago

For example, a file contains 80 character long lines. If the -> key is pressed, it scrolls horizontally. If it is pressed again, it scrolls again, although there is no text. It seems to me it don't have a limit to horizontal scrolling.

tigrawap commented 6 years ago

I don't think "fixing" this will be right thing to do. No way to know longest line in future. (ofc can save longest line found so far, but not reliably)

Now imagine: 150 chars line many short chart lines 150 chars line

Long lines are the interesting lines, so I align screen to them and start scrolling vertically If it will restrain to shortest line on screen - then will have to scroll right again to see interesting line

The only viable option, is to restrict horizontal scrolling to longest line only if it's invoked directly on current screen.

I'll see what can be done... but right now positioning and drawing are very different entities with no cross-communication

notramo commented 6 years ago

What about allowing scrolling to the length of the longest line always? With your example, if only the many short lines are on the screen, it would allow also to scroll 150 characters.