summaryrefslogtreecommitdiff
path: root/position.c
diff options
context:
space:
mode:
Diffstat (limited to 'position.c')
-rw-r--r--position.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/position.c b/position.c
index 69ab7a8ecbc4..66e501c09060 100644
--- a/position.c
+++ b/position.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2024 Mark Nudelman
+ * Copyright (C) 1984-2025 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.
@@ -26,6 +26,7 @@ static int table_size = 0;
extern int sc_width, sc_height;
extern int hshift;
+extern int shell_lines;
/*
* Return the starting file position of a line displayed on the screen.
@@ -46,6 +47,9 @@ public POSITION position(int sindex)
case BOTTOM_PLUS_ONE:
sindex = sc_height - 1;
break;
+ case BOTTOM_OFFSET:
+ sindex = sc_height - shell_lines;
+ break;
case MIDDLE:
sindex = (sc_height - 1) / 2;
break;
@@ -56,15 +60,18 @@ public POSITION position(int sindex)
/*
* Add a new file position to the bottom of the position table.
*/
-public void add_forw_pos(POSITION pos)
+public void add_forw_pos(POSITION pos, lbool no_scroll)
{
int i;
/*
* Scroll the position table up.
*/
- for (i = 1; i < sc_height; i++)
- table[i-1] = table[i];
+ if (!no_scroll)
+ {
+ for (i = 1; i < sc_height; i++)
+ table[i-1] = table[i];
+ }
table[sc_height - 1] = pos;
}