summaryrefslogtreecommitdiffstats
path: root/src/diff.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-31 18:34:32 +0100
committerBram Moolenaar <Bram@vim.org>2022-07-31 18:34:32 +0100
commit101d57b34b72f4fbc7df1b6edfd64c64a6be14fc (patch)
tree246feb7236973fb7a526652ab5795f49a808e553 /src/diff.c
parentc146d974f13450453a7c1f5ab10b105c515f0ccb (diff)
patch 9.0.0124: code has more indent than neededv9.0.0124
Problem: Code has more indent than needed. Solution: Use continue and return statements. (closes #10824)
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/diff.c b/src/diff.c
index fb43eee844..43feb2a8b3 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)
{