weeding: remove ensure_line_is_visible()

Since all lines can be partially scrolled off the screen now
(except for the top line of the edit window, which is forthcoming),
ensure_line_is_visible() is no longer needed.
master
David Lawrence Ramsey 2017-01-31 15:31:38 -06:00 committed by Benno Schulenberg
parent 812ecaeb0c
commit 80b3a3011b
5 changed files with 0 additions and 21 deletions

View File

@ -1196,8 +1196,6 @@ void do_insertfile(void)
/* Update the cursor position to account for inserted lines. */
reset_cursor();
ensure_line_is_visible();
refresh_needed = TRUE;
}

View File

@ -44,7 +44,6 @@ void do_last_line(void)
/* Set the last line of the screen as the target for the cursor. */
openfile->current_y = editwinrows - 1;
ensure_line_is_visible();
refresh_needed = TRUE;
focusing = FALSE;
@ -341,19 +340,6 @@ void do_next_word_void(void)
do_next_word(ISSET(WORD_BOUNDS), TRUE);
}
/* Make sure that the current line, when it is partially scrolled off the
* screen in softwrap mode, is scrolled fully into view. */
void ensure_line_is_visible(void)
{
#ifndef NANO_TINY
if (ISSET(SOFTWRAP) && strlenpt(openfile->current->data) / editwincols +
openfile->current_y >= editwinrows) {
adjust_viewport(ISSET(SMOOTH_SCROLL) ? FLOWING : CENTERING);
refresh_needed = TRUE;
}
#endif
}
/* Move to the beginning of the current line (or softwrapped chunk).
* If be_clever is TRUE, do a smart home when wanted and possible,
* and do a dynamic home when in softwrap mode and it'spossible.

View File

@ -1877,8 +1877,6 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
}
#ifndef NANO_TINY
ensure_line_is_visible();
/* If the number of screen rows that a softwrapped line occupies
* has changed, we need a full refresh. */
if (ISSET(SOFTWRAP) && refresh_needed == FALSE)

View File

@ -383,7 +383,6 @@ void do_prev_word(bool allow_punct, bool allow_update);
void do_prev_word_void(void);
bool do_next_word(bool allow_punct, bool allow_update);
void do_next_word_void(void);
void ensure_line_is_visible(void);
void do_home(bool be_clever);
void do_home_void(void);
void do_end(bool be_clever);

View File

@ -179,8 +179,6 @@ void do_deletion(undo_type action)
return;
#ifndef NANO_TINY
ensure_line_is_visible();
/* If the number of screen rows that a softwrapped line occupies
* has changed, we need a full refresh. */
if (ISSET(SOFTWRAP) && refresh_needed == FALSE)