summaryrefslogtreecommitdiffstats
path: root/contrib/less/jump.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2007-10-08 16:14:52 +0000
committerdelphij <delphij@FreeBSD.org>2007-10-08 16:14:52 +0000
commitaa9fcd738666aeeba852b8c048517501f6704bc0 (patch)
tree2a78cc9eb4488e323c6e10ad2cee170d3b3eed87 /contrib/less/jump.c
parentbb6dbdf2f382ed564a935433f1553a0c588e0f5f (diff)
downloadFreeBSD-src-aa9fcd738666aeeba852b8c048517501f6704bc0.zip
FreeBSD-src-aa9fcd738666aeeba852b8c048517501f6704bc0.tar.gz
Virgin import of less v408.
Approved by: re (kensmith)
Diffstat (limited to 'contrib/less/jump.c')
-rw-r--r--contrib/less/jump.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/contrib/less/jump.c b/contrib/less/jump.c
index 6e0c90d..585d9b2 100644
--- a/contrib/less/jump.c
+++ b/contrib/less/jump.c
@@ -31,6 +31,7 @@ extern int top_scroll;
jump_forw()
{
POSITION pos;
+ POSITION end_pos;
if (ch_end_seek())
{
@@ -42,11 +43,17 @@ jump_forw()
* Go back one line from the end of the file
* to get to the beginning of the last line.
*/
- pos = back_line(ch_tell());
+ pos_clear();
+ end_pos = ch_tell();
+ pos = back_line(end_pos);
if (pos == NULL_POSITION)
jump_loc((POSITION)0, sc_height-1);
else
+ {
jump_loc(pos, sc_height-1);
+ if (position(sc_height-1) != end_pos)
+ repaint();
+ }
}
/*
OpenPOWER on IntegriCloud