Skip to content

Commit

Permalink
fix(PVS/V583): the '?:' operator always returns one and the same value (
Browse files Browse the repository at this point in the history
  • Loading branch information
dundargoc committed Mar 20, 2022
1 parent 1890075 commit e9b53f3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/nvim/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir)
}
}
} else {
hsep_height = global_stl_height() > 0 ? 1 : STATUS_HEIGHT;
hsep_height = STATUS_HEIGHT;
layout = FR_COL;

/*
Expand Down Expand Up @@ -1374,8 +1374,7 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir)
}
frame_new_height(curfrp, new_fr_height, flags & WSP_TOP, false);
} else {
win_new_height(oldwin, oldwin_height - (new_size
+ (global_stl_height() > 0 ? 1 : STATUS_HEIGHT)));
win_new_height(oldwin, oldwin_height - (new_size + STATUS_HEIGHT));
}

if (before) { // new window above current one
Expand Down Expand Up @@ -1643,7 +1642,7 @@ int make_windows(int count, bool vertical)
// Each window needs at least 'winminheight' lines
// If statusline isn't global, each window also needs a statusline
maxcount = (curwin->w_height + curwin->w_hsep_height + curwin->w_status_height
- (p_wh - p_wmh)) / (p_wmh + (global_stl_height() > 0 ? 1 : STATUS_HEIGHT));
- (p_wh - p_wmh)) / (p_wmh + STATUS_HEIGHT);
}

if (maxcount < 2) {
Expand Down Expand Up @@ -2166,7 +2165,7 @@ static void win_equal_rec(win_T *next_curwin, bool current, frame_T *topfr, int
totwincount -= wincount;
}
} else { // topfr->fr_layout == FR_COL
hsep_height = global_stl_height() > 0 ? 1 : STATUS_HEIGHT;
hsep_height = STATUS_HEIGHT;
topfr->fr_width = width;
topfr->fr_height = height;

Expand Down

0 comments on commit e9b53f3

Please sign in to comment.