diff --git a/src/files.c b/src/files.c index 2498ca66d5f339cae45456b0f12ff7ac596d225b..cfe43ab3ae8e00e7c9a1b93a0e55039e6a84b711 100644 --- a/src/files.c +++ b/src/files.c @@ -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; } diff --git a/src/move.c b/src/move.c index 178cd1b024c5472c04bc2ffa988cee2d6f520ff6..031bfe14bde60d95021c5522fff9b03646f596cb 100644 --- a/src/move.c +++ b/src/move.c @@ -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. diff --git a/src/nano.c b/src/nano.c index 4b8e7c45099711f9ed68da013208bb024151469c..2155d8ea622fa6fa9737e79658af31ea3a405482 100644 --- a/src/nano.c +++ b/src/nano.c @@ -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) diff --git a/src/proto.h b/src/proto.h index 707e3d56a5918824b25f9c474a7c3eac2bf9f7c9..fb941491f80f1abc7aab5f3dd6589dff4fa337da 100644 --- a/src/proto.h +++ b/src/proto.h @@ -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); diff --git a/src/text.c b/src/text.c index e4ac691696d955305df72a48738d361e11dea2ea..8fde8815c419317d24dde401f700b5af230006a5 100644 --- a/src/text.c +++ b/src/text.c @@ -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)