refactor: follow style guide

- reduce variable scope
- prefer initialization over declaration and assignment
This commit is contained in:
dundargoc
2023-11-13 23:40:37 +01:00
committed by dundargoc
parent 1798a4b5e9
commit ac1113ded5
52 changed files with 713 additions and 1269 deletions

View File

@@ -167,9 +167,7 @@ int lbr_chartabsize(chartabsize_T *cts)
/// @return The number of characters take up on the screen.
int lbr_chartabsize_adv(chartabsize_T *cts)
{
int retval;
retval = lbr_chartabsize(cts);
int retval = lbr_chartabsize(cts);
MB_PTR_ADV(cts->cts_ptr);
return retval;
}
@@ -399,14 +397,13 @@ static int win_nolbr_chartabsize(chartabsize_T *cts, int *headp)
win_T *wp = cts->cts_win;
char *s = cts->cts_ptr;
colnr_T col = cts->cts_vcol;
int n;
if ((*s == TAB) && (!wp->w_p_list || wp->w_p_lcs_chars.tab1)) {
return tabstop_padding(col,
wp->w_buffer->b_p_ts,
wp->w_buffer->b_p_vts_array);
}
n = ptr2cells(s);
int n = ptr2cells(s);
// Add one cell for a double-width character in the last column of the
// window, displayed with a ">".