summaryrefslogtreecommitdiffstats
path: root/contrib/less/forwback.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/less/forwback.c')
-rw-r--r--contrib/less/forwback.c40
1 files changed, 18 insertions, 22 deletions
diff --git a/contrib/less/forwback.c b/contrib/less/forwback.c
index 1eafd6a..a514c9f 100644
--- a/contrib/less/forwback.c
+++ b/contrib/less/forwback.c
@@ -1,5 +1,6 @@
+/* $FreeBSD$ */
/*
- * Copyright (C) 1984-2007 Mark Nudelman
+ * Copyright (C) 1984-2005 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.
@@ -21,19 +22,19 @@ 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 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
@@ -78,7 +79,7 @@ eof_check()
* of the screen; this can happen when we display a short file
* for the first time.
*/
- public void
+ static void
squish_check()
{
if (!squished)
@@ -136,8 +137,12 @@ forw(n, pos, force, only_last, nblank)
pos_clear();
add_forw_pos(pos);
force = 1;
- clear();
- home();
+ if (more_mode == 0)
+ {
+ if (top_scroll == OPT_ONPLUS || (first_time && top_scroll != OPT_ON))
+ clear();
+ home();
+ }
} else
{
clear_bot();
@@ -155,7 +160,8 @@ forw(n, pos, force, only_last, nblank)
force = 1;
if (top_scroll)
{
- clear();
+ if (top_scroll == OPT_ONPLUS)
+ clear();
home();
} else if (!first_time)
{
@@ -220,7 +226,8 @@ 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 && pos == NULL_POSITION && !top_scroll &&
+ if ((first_time || more_mode) &&
+ pos == NULL_POSITION && !top_scroll &&
#if TAGS
tagoption == NULL &&
#endif
@@ -229,16 +236,9 @@ 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,8 +250,6 @@ forw(n, pos, force, only_last, nblank)
*/
clear_eol();
}
-#endif
- forw_prompt = 1;
}
if (ignore_eoi)
@@ -317,8 +315,6 @@ back(n, pos, force, only_last)
eof_bell();
else if (do_repaint)
repaint();
- else if (!oldbot)
- lower_left();
(void) currline(BOTTOM);
}
@@ -334,7 +330,7 @@ forward(n, force, only_last)
{
POSITION pos;
- if (get_quit_at_eof() && hit_eof && !(ch_getflags() & CH_HELPFILE))
+ if (quit_at_eof && hit_eof && !(ch_getflags() & CH_HELPFILE))
{
/*
* If the -e flag is set and we're trying to go
OpenPOWER on IntegriCloud