aboutsummaryrefslogtreecommitdiff
path: root/contrib/less/jump.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2007-10-08 16:14:52 +0000
committerXin LI <delphij@FreeBSD.org>2007-10-08 16:14:52 +0000
commit1c6a5c10a362fd36b365582979f652431752c99a (patch)
tree2a78cc9eb4488e323c6e10ad2cee170d3b3eed87 /contrib/less/jump.c
parentefd72c2eb66e67c4f367ba48c3effd0ae2a668e1 (diff)
downloadsrc-1c6a5c10a362fd36b365582979f652431752c99a.tar.gz
src-1c6a5c10a362fd36b365582979f652431752c99a.zip
Notes
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 6e0c90dbcc10..585d9b209e6d 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();
+ }
}
/*