From 101d57b34b72f4fbc7df1b6edfd64c64a6be14fc Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 31 Jul 2022 18:34:32 +0100 Subject: patch 9.0.0124: code has more indent than needed Problem: Code has more indent than needed. Solution: Use continue and return statements. (closes #10824) --- src/diff.c | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) (limited to 'src/diff.c') diff --git a/src/diff.c b/src/diff.c index fb43eee84..43feb2a8b 100644 --- a/src/diff.c +++ b/src/diff.c @@ -678,34 +678,36 @@ diff_redraw( need_diff_redraw = FALSE; FOR_ALL_WINDOWS(wp) + { // when closing windows or wiping buffers skip invalid window - if (wp->w_p_diff && buf_valid(wp->w_buffer)) - { - redraw_win_later(wp, SOME_VALID); - if (wp != curwin) - wp_other = wp; + if (!wp->w_p_diff || !buf_valid(wp->w_buffer)) + continue; + + redraw_win_later(wp, SOME_VALID); + if (wp != curwin) + wp_other = wp; #ifdef FEAT_FOLDING - if (dofold && foldmethodIsDiff(wp)) - foldUpdateAll(wp); + if (dofold && foldmethodIsDiff(wp)) + foldUpdateAll(wp); #endif - // A change may have made filler lines invalid, need to take care - // of that for other windows. - n = diff_check(wp, wp->w_topline); - if ((wp != curwin && wp->w_topfill > 0) || n > 0) + // A change may have made filler lines invalid, need to take care of + // that for other windows. + n = diff_check(wp, wp->w_topline); + if ((wp != curwin && wp->w_topfill > 0) || n > 0) + { + if (wp->w_topfill > n) + wp->w_topfill = (n < 0 ? 0 : n); + else if (n > 0 && n > wp->w_topfill) { - if (wp->w_topfill > n) - wp->w_topfill = (n < 0 ? 0 : n); - else if (n > 0 && n > wp->w_topfill) - { - wp->w_topfill = n; - if (wp == curwin) - used_max_fill_curwin = TRUE; - else if (wp_other != NULL) - used_max_fill_other = TRUE; - } - check_topfill(wp, FALSE); + wp->w_topfill = n; + if (wp == curwin) + used_max_fill_curwin = TRUE; + else if (wp_other != NULL) + used_max_fill_other = TRUE; } + check_topfill(wp, FALSE); } + } if (wp_other != NULL && curwin->w_p_scb) { -- cgit v1.2.1