Commit 80b3a301 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey Committed by Benno Schulenberg
Browse files

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.
No related merge requests found
Showing with 0 additions and 21 deletions
+0 -21
...@@ -1196,8 +1196,6 @@ void do_insertfile(void) ...@@ -1196,8 +1196,6 @@ void do_insertfile(void)
/* Update the cursor position to account for inserted lines. */ /* Update the cursor position to account for inserted lines. */
reset_cursor(); reset_cursor();
ensure_line_is_visible();
refresh_needed = TRUE; refresh_needed = TRUE;
} }
......
...@@ -44,7 +44,6 @@ void do_last_line(void) ...@@ -44,7 +44,6 @@ void do_last_line(void)
/* Set the last line of the screen as the target for the cursor. */ /* Set the last line of the screen as the target for the cursor. */
openfile->current_y = editwinrows - 1; openfile->current_y = editwinrows - 1;
ensure_line_is_visible();
refresh_needed = TRUE; refresh_needed = TRUE;
focusing = FALSE; focusing = FALSE;
...@@ -341,19 +340,6 @@ void do_next_word_void(void) ...@@ -341,19 +340,6 @@ void do_next_word_void(void)
do_next_word(ISSET(WORD_BOUNDS), TRUE); 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). /* Move to the beginning of the current line (or softwrapped chunk).
* If be_clever is TRUE, do a smart home when wanted and possible, * 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. * and do a dynamic home when in softwrap mode and it'spossible.
......
...@@ -1877,8 +1877,6 @@ void do_output(char *output, size_t output_len, bool allow_cntrls) ...@@ -1877,8 +1877,6 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
} }
#ifndef NANO_TINY #ifndef NANO_TINY
ensure_line_is_visible();
/* If the number of screen rows that a softwrapped line occupies /* If the number of screen rows that a softwrapped line occupies
* has changed, we need a full refresh. */ * has changed, we need a full refresh. */
if (ISSET(SOFTWRAP) && refresh_needed == FALSE) if (ISSET(SOFTWRAP) && refresh_needed == FALSE)
......
...@@ -383,7 +383,6 @@ void do_prev_word(bool allow_punct, bool allow_update); ...@@ -383,7 +383,6 @@ void do_prev_word(bool allow_punct, bool allow_update);
void do_prev_word_void(void); void do_prev_word_void(void);
bool do_next_word(bool allow_punct, bool allow_update); bool do_next_word(bool allow_punct, bool allow_update);
void do_next_word_void(void); void do_next_word_void(void);
void ensure_line_is_visible(void);
void do_home(bool be_clever); void do_home(bool be_clever);
void do_home_void(void); void do_home_void(void);
void do_end(bool be_clever); void do_end(bool be_clever);
......
...@@ -179,8 +179,6 @@ void do_deletion(undo_type action) ...@@ -179,8 +179,6 @@ void do_deletion(undo_type action)
return; return;
#ifndef NANO_TINY #ifndef NANO_TINY
ensure_line_is_visible();
/* If the number of screen rows that a softwrapped line occupies /* If the number of screen rows that a softwrapped line occupies
* has changed, we need a full refresh. */ * has changed, we need a full refresh. */
if (ISSET(SOFTWRAP) && refresh_needed == FALSE) if (ISSET(SOFTWRAP) && refresh_needed == FALSE)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment