tweaks: frob some parentheses and other things, to be more consistent

master
Benno Schulenberg 2017-03-29 19:30:37 +02:00
parent c7282e8821
commit 582a624998
3 changed files with 12 additions and 12 deletions

View File

@ -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;
}

View File

@ -1891,10 +1891,10 @@ 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))
xplustabs() / editwincols != original_row)))
refresh_needed = TRUE;
#endif

View File

@ -181,8 +181,8 @@ 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)
if (ISSET(SOFTWRAP) && refresh_needed == FALSE &&
strlenpt(openfile->current->data) / editwincols != orig_rows)
refresh_needed = TRUE;
#endif