aboutsummaryrefslogtreecommitdiff
path: root/jump.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2017-04-25 03:42:16 +0000
committerXin LI <delphij@FreeBSD.org>2017-04-25 03:42:16 +0000
commit9c83c2751d26fe2e059d6956f0398b56ed919a6a (patch)
treeb75ed451f9f8336fb4958dbae186b6bd98aa65c0 /jump.c
parent1cabeb1f0c93e44ebc8a1d3a78100a962ac3f047 (diff)
Vendor import of less 487.vendor/less/v487
Diffstat (limited to 'jump.c')
-rw-r--r--jump.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/jump.c b/jump.c
index 16bd22d58036..b5ec9dd8f339 100644
--- a/jump.c
+++ b/jump.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2015 Mark Nudelman
+ * Copyright (C) 1984-2016 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,7 +26,7 @@ extern int top_scroll;
* Jump to the end of the file.
*/
public void
-jump_forw(void)
+jump_forw()
{
POSITION pos;
POSITION end_pos;
@@ -64,7 +64,7 @@ jump_forw(void)
* Jump to the last buffered line in the file.
*/
public void
-jump_forw_buffered(void)
+jump_forw_buffered()
{
POSITION end;
@@ -82,7 +82,8 @@ jump_forw_buffered(void)
* Jump to line n in the file.
*/
public void
-jump_back(LINENUM linenum)
+jump_back(linenum)
+ LINENUM linenum;
{
POSITION pos;
PARG parg;
@@ -114,7 +115,7 @@ jump_back(LINENUM linenum)
* Repaint the screen.
*/
public void
-repaint(void)
+repaint()
{
struct scrpos scrpos;
/*
@@ -123,14 +124,20 @@ repaint(void)
*/
get_scrpos(&scrpos);
pos_clear();
- jump_loc(scrpos.pos, scrpos.ln);
+ if (scrpos.pos == NULL_POSITION)
+ /* Screen hasn't been drawn yet. */
+ jump_loc(0, 0);
+ else
+ jump_loc(scrpos.pos, scrpos.ln);
}
/*
* Jump to a specified percentage into the file.
*/
public void
-jump_percent(int percent, long fraction)
+jump_percent(percent, fraction)
+ int percent;
+ long fraction;
{
POSITION pos, len;
@@ -161,7 +168,9 @@ jump_percent(int percent, long fraction)
* the first character in a line.
*/
public void
-jump_line_loc(POSITION pos, int sline)
+jump_line_loc(pos, sline)
+ POSITION pos;
+ int sline;
{
int c;
@@ -187,9 +196,11 @@ jump_line_loc(POSITION pos, int sline)
* Place the target line on a specified line on the screen.
*/
public void
-jump_loc(POSITION pos, int sline)
+jump_loc(pos, sline)
+ POSITION pos;
+ int sline;
{
- int nline;
+ register int nline;
POSITION tpos;
POSITION bpos;