jump.c (170256) | jump.c (172468) |
---|---|
1/* 2 * Copyright (C) 1984-2007 Mark Nudelman 3 * 4 * You may distribute under the terms of either the GNU General Public 5 * License or the Less License, as specified in the README file. 6 * 7 * For more information about less, or for information on how to 8 * contact the author, see the README file. --- 17 unchanged lines hidden (view full) --- 26 27/* 28 * Jump to the end of the file. 29 */ 30 public void 31jump_forw() 32{ 33 POSITION pos; | 1/* 2 * Copyright (C) 1984-2007 Mark Nudelman 3 * 4 * You may distribute under the terms of either the GNU General Public 5 * License or the Less License, as specified in the README file. 6 * 7 * For more information about less, or for information on how to 8 * contact the author, see the README file. --- 17 unchanged lines hidden (view full) --- 26 27/* 28 * Jump to the end of the file. 29 */ 30 public void 31jump_forw() 32{ 33 POSITION pos; |
34 POSITION end_pos; |
|
34 35 if (ch_end_seek()) 36 { 37 error("Cannot seek to end of file", NULL_PARG); 38 return; 39 } 40 /* 41 * Position the last line in the file at the last screen line. 42 * Go back one line from the end of the file 43 * to get to the beginning of the last line. 44 */ | 35 36 if (ch_end_seek()) 37 { 38 error("Cannot seek to end of file", NULL_PARG); 39 return; 40 } 41 /* 42 * Position the last line in the file at the last screen line. 43 * Go back one line from the end of the file 44 * to get to the beginning of the last line. 45 */ |
45 pos = back_line(ch_tell()); | 46 pos_clear(); 47 end_pos = ch_tell(); 48 pos = back_line(end_pos); |
46 if (pos == NULL_POSITION) 47 jump_loc((POSITION)0, sc_height-1); 48 else | 49 if (pos == NULL_POSITION) 50 jump_loc((POSITION)0, sc_height-1); 51 else |
52 { |
|
49 jump_loc(pos, sc_height-1); | 53 jump_loc(pos, sc_height-1); |
54 if (position(sc_height-1) != end_pos) 55 repaint(); 56 } |
|
50} 51 52/* 53 * Jump to line n in the file. 54 */ 55 public void 56jump_back(linenum) 57 LINENUM linenum; --- 235 unchanged lines hidden --- | 57} 58 59/* 60 * Jump to line n in the file. 61 */ 62 public void 63jump_back(linenum) 64 LINENUM linenum; --- 235 unchanged lines hidden --- |