diff options
Diffstat (limited to 'contrib/less/forwback.c')
-rw-r--r-- | contrib/less/forwback.c | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/contrib/less/forwback.c b/contrib/less/forwback.c index a514c9f..309eef6 100644 --- a/contrib/less/forwback.c +++ b/contrib/less/forwback.c @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* - * Copyright (C) 1984-2005 Mark Nudelman + * Copyright (C) 1984-2007 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -22,19 +22,20 @@ public int hit_eof; /* Keeps track of how many times we hit end of file */ public int screen_trashed; public int squished; public int no_back_scroll = 0; +public int forw_prompt; extern int sigs; extern int top_scroll; extern int quiet; extern int sc_width, sc_height; -extern int quit_at_eof; -extern int more_mode; +extern int less_is_more; extern int plusoption; extern int forw_scroll; extern int back_scroll; extern int ignore_eoi; extern int clear_bg; extern int final_attr; +extern int oldbot; #if TAGS extern char *tagoption; #endif @@ -79,7 +80,7 @@ eof_check() * of the screen; this can happen when we display a short file * for the first time. */ - static void + public void squish_check() { if (!squished) @@ -137,10 +138,8 @@ forw(n, pos, force, only_last, nblank) pos_clear(); add_forw_pos(pos); force = 1; - if (more_mode == 0) - { - if (top_scroll == OPT_ONPLUS || (first_time && top_scroll != OPT_ON)) - clear(); + if (less_is_more == 0) { + clear(); home(); } } else @@ -160,8 +159,7 @@ forw(n, pos, force, only_last, nblank) force = 1; if (top_scroll) { - if (top_scroll == OPT_ONPLUS) - clear(); + clear(); home(); } else if (!first_time) { @@ -226,7 +224,7 @@ forw(n, pos, force, only_last, nblank) * start the display after the beginning of the file, * and it is not appropriate to squish in that case. */ - if ((first_time || more_mode) && + if ((first_time || less_is_more) && pos == NULL_POSITION && !top_scroll && #if TAGS tagoption == NULL && @@ -236,9 +234,16 @@ forw(n, pos, force, only_last, nblank) squished = 1; continue; } - if (top_scroll == OPT_ON) - clear_eol(); put_line(); +#if 0 + /* {{ + * Can't call clear_eol here. The cursor might be at end of line + * on an ignaw terminal, so clear_eol would clear the last char + * of the current line instead of all of the next line. + * If we really need to do this on clear_bg terminals, we need + * to find a better way. + * }} + */ if (clear_bg && apply_at_specials(final_attr) != AT_NORMAL) { /* @@ -250,6 +255,8 @@ forw(n, pos, force, only_last, nblank) */ clear_eol(); } +#endif + forw_prompt = 1; } if (ignore_eoi) @@ -315,6 +322,8 @@ back(n, pos, force, only_last) eof_bell(); else if (do_repaint) repaint(); + else if (!oldbot) + lower_left(); (void) currline(BOTTOM); } @@ -330,7 +339,7 @@ forward(n, force, only_last) { POSITION pos; - if (quit_at_eof && hit_eof && !(ch_getflags() & CH_HELPFILE)) + if (get_quit_at_eof() && hit_eof && !(ch_getflags() & CH_HELPFILE)) { /* * If the -e flag is set and we're trying to go |