diff --git a/src/winio.c b/src/winio.c index ad37b3acd0e22a5a12cb71725e86247e1009bda7..bf6fdba98cd0e791828d27099ad6f065ab82a689 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2689,28 +2689,7 @@ int update_line(filestruct *fileptr, size_t index) return 0; #ifndef NANO_TINY - if (!ISSET(SOFTWRAP)) { -#endif - /* First, blank out the row. */ - blank_row(edit, row, 0, COLS); - - /* Next, find out from which column to start displaying the line. */ - from_col = get_page_start(strnlenpt(fileptr->data, index)); - - /* Expand the line, replacing tabs with spaces, and control - * characters with their displayed forms. */ - converted = display_string(fileptr->data, from_col, editwincols, TRUE); - - /* Draw the line. */ - edit_draw(fileptr, converted, row, from_col); - free(converted); - - if (from_col > 0) - mvwaddch(edit, row, margin, '$'); - if (strlenpt(fileptr->data) > from_col + editwincols) - mvwaddch(edit, row, COLS - 1, '$'); -#ifndef NANO_TINY - } else { + if (ISSET(SOFTWRAP)) { size_t full_length = strlenpt(fileptr->data); for (from_col = 0; from_col <= full_length && @@ -2733,6 +2712,25 @@ int update_line(filestruct *fileptr, size_t index) } #endif + /* First, blank out the row. */ + blank_row(edit, row, 0, COLS); + + /* Next, find out from which column to start displaying the line. */ + from_col = get_page_start(strnlenpt(fileptr->data, index)); + + /* Expand the line, replacing tabs with spaces, and control + * characters with their displayed forms. */ + converted = display_string(fileptr->data, from_col, editwincols, TRUE); + + /* Draw the line. */ + edit_draw(fileptr, converted, row, from_col); + free(converted); + + if (from_col > 0) + mvwaddch(edit, row, margin, '$'); + if (strlenpt(fileptr->data) > from_col + editwincols) + mvwaddch(edit, row, COLS - 1, '$'); + return 0; }