diff options
Diffstat (limited to 'jump.c')
| -rw-r--r-- | jump.c | 31 |
1 files changed, 21 insertions, 10 deletions
@@ -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; |
