diff --git a/src/move.c b/src/move.c index c83ade21..641d0764 100644 --- a/src/move.c +++ b/src/move.c @@ -395,8 +395,8 @@ void do_home(bool be_clever) openfile->placewewant = xplustabs(); - /* If we changed chunk, we might be offscreen. Otherwise, update - * current if the mark is on or we changed "page". */ + /* If we changed chunk, we might be offscreen. Otherwise, + * update current if the mark is on or we changed "page". */ if (ISSET(SOFTWRAP) && moved_off_chunk) { focusing = FALSE; edit_redraw(was_current); @@ -426,8 +426,8 @@ void do_end(bool be_clever) ((was_column / editwincols) * editwincols) + (editwincols - 1)); - /* If already at the right edge of the screen, move fully to the - * end of the line. Otherwise, move to the right edge. */ + /* If already at the right edge of the screen, move fully to + * the end of the line. Otherwise, move to the right edge. */ if (openfile->current_x == rightedge_x && be_clever) openfile->current_x = line_len; else { @@ -587,7 +587,7 @@ void do_left(void) * we're now above the first line of the edit window, so scroll up. */ if (ISSET(SOFTWRAP) && openfile->current_y == 0 && openfile->current == was_current && - (openfile->placewewant / editwincols) != was_chunk) { + openfile->placewewant / editwincols != was_chunk) { edit_scroll(UPWARD, ISSET(SMOOTH_SCROLL) ? 1 : editwinrows / 2 + 1); return; } diff --git a/src/nano.c b/src/nano.c index 9647e013..1063e9b1 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1891,11 +1891,11 @@ void do_output(char *output, size_t output_len, bool allow_cntrls) * changed, we need a full refresh. And if we were on the last line * of the edit window, and we moved one screen row, we're now below * the last line of the edit window, so we need a full refresh too. */ - if (ISSET(SOFTWRAP) && refresh_needed == FALSE) - if ((strlenpt(openfile->current->data) / editwincols) != orig_rows || + if (ISSET(SOFTWRAP) && refresh_needed == FALSE && + (strlenpt(openfile->current->data) / editwincols != orig_rows || (openfile->current_y == editwinrows - 1 && - xplustabs() / editwincols != original_row)) - refresh_needed = TRUE; + xplustabs() / editwincols != original_row))) + refresh_needed = TRUE; #endif free(char_buf); diff --git a/src/text.c b/src/text.c index 97ea9bc2..fc92d11c 100644 --- a/src/text.c +++ b/src/text.c @@ -181,9 +181,9 @@ void do_deletion(undo_type action) #ifndef NANO_TINY /* If the number of screen rows that a softwrapped line occupies * has changed, we need a full refresh. */ - if (ISSET(SOFTWRAP) && refresh_needed == FALSE) - if ((strlenpt(openfile->current->data) / editwincols) != orig_rows) - refresh_needed = TRUE; + if (ISSET(SOFTWRAP) && refresh_needed == FALSE && + strlenpt(openfile->current->data) / editwincols != orig_rows) + refresh_needed = TRUE; #endif set_modified();