forwback.c (7e1b7636c894be9d1130c284089ce1ea0786ecec) | forwback.c (b2ea244070ff84eab79e04befb7aa30c982fc84d) |
---|---|
1/* $FreeBSD$ */ 2/* 3 * Copyright (C) 1984-2017 Mark Nudelman 4 * 5 * You may distribute under the terms of either the GNU General Public 6 * License or the Less License, as specified in the README file. 7 * 8 * For more information, see the README file. --- 276 unchanged lines hidden (view full) --- 285 * Now we're in normal mode again, so clear the line. 286 */ 287 clear_eol(); 288 } 289#endif 290 forw_prompt = 1; 291 } 292 | 1/* $FreeBSD$ */ 2/* 3 * Copyright (C) 1984-2017 Mark Nudelman 4 * 5 * You may distribute under the terms of either the GNU General Public 6 * License or the Less License, as specified in the README file. 7 * 8 * For more information, see the README file. --- 276 unchanged lines hidden (view full) --- 285 * Now we're in normal mode again, so clear the line. 286 */ 287 clear_eol(); 288 } 289#endif 290 forw_prompt = 1; 291 } 292 |
293 if (nlines == 0 && same_pos_bell) | 293 if (nlines == 0 && !ignore_eoi && same_pos_bell) |
294 eof_bell(); 295 else if (do_repaint) 296 repaint(); 297 first_time = 0; 298 (void) currline(BOTTOM); 299} 300 301/* --- 144 unchanged lines hidden (view full) --- 446 if (back_scroll >= 0) 447 return (back_scroll); 448 if (top_scroll) 449 return (sc_height - 2); 450 return (10000); /* infinity */ 451} 452 453/* | 294 eof_bell(); 295 else if (do_repaint) 296 repaint(); 297 first_time = 0; 298 (void) currline(BOTTOM); 299} 300 301/* --- 144 unchanged lines hidden (view full) --- 446 if (back_scroll >= 0) 447 return (back_scroll); 448 if (top_scroll) 449 return (sc_height - 2); 450 return (10000); /* infinity */ 451} 452 453/* |
454 * Get line count of file up to the screen height + 1 char | 454 * Return number of displayable lines in the file. 455 * Stop counting at screen height + 1. |
455 */ 456 public int 457get_line_count() 458{ 459 int nlines; | 456 */ 457 public int 458get_line_count() 459{ 460 int nlines; |
460 POSITION pos; | 461 POSITION pos = ch_zero(); |
461 | 462 |
462 pos = ch_zero(); | |
463 for (nlines = 0; nlines <= sc_height; nlines++) 464 { 465 pos = forw_line(pos); 466 if (pos == NULL_POSITION) break; 467 } 468 return nlines; 469} | 463 for (nlines = 0; nlines <= sc_height; nlines++) 464 { 465 pos = forw_line(pos); 466 if (pos == NULL_POSITION) break; 467 } 468 return nlines; 469} |