Skip to content

Commit 0119a59

Browse files
committed
patch 8.1.0114: confusing variable name
Problem: Confusing variable name. Solution: Rename new_ts to new_vts_array. Change zero to NULL.
1 parent 675e8d6 commit 0119a59

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

src/ex_cmds.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ ex_retab(exarg_T *eap)
678678
char_u *new_line = (char_u *)1; /* init to non-NULL */
679679
int did_undo; /* called u_save for current line */
680680
#ifdef FEAT_VARTABS
681-
int *new_ts = 0;
681+
int *new_vts_array = NULL;
682682
char_u *new_ts_str; /* string value of tab argument */
683683
#else
684684
int temp;
@@ -693,16 +693,17 @@ ex_retab(exarg_T *eap)
693693

694694
#ifdef FEAT_VARTABS
695695
new_ts_str = eap->arg;
696-
if (!tabstop_set(eap->arg, &new_ts))
696+
if (!tabstop_set(eap->arg, &new_vts_array))
697697
return;
698698
while (vim_isdigit(*(eap->arg)) || *(eap->arg) == ',')
699699
++(eap->arg);
700700

701-
// This ensures that either new_ts and new_ts_str are freshly allocated,
702-
// or new_ts points to an existing array and new_ts_str is null.
703-
if (new_ts == 0)
701+
// This ensures that either new_vts_array and new_ts_str are freshly
702+
// allocated, or new_vts_array points to an existing array and new_ts_str
703+
// is null.
704+
if (new_vts_array == NULL)
704705
{
705-
new_ts = curbuf->b_p_vts_array;
706+
new_vts_array = curbuf->b_p_vts_array;
706707
new_ts_str = NULL;
707708
}
708709
else
@@ -753,9 +754,7 @@ ex_retab(exarg_T *eap)
753754
int t, s;
754755

755756
tabstop_fromto(start_vcol, vcol,
756-
tabstop_count(new_ts)? 0: curbuf->b_p_ts,
757-
new_ts,
758-
&t, &s);
757+
curbuf->b_p_ts, new_vts_array, &t, &s);
759758
num_tabs = t;
760759
num_spaces = s;
761760
#else
@@ -829,11 +828,11 @@ ex_retab(exarg_T *eap)
829828
// If a single value was given then it can be considered equal to
830829
// either the value of 'tabstop' or the value of 'vartabstop'.
831830
if (tabstop_count(curbuf->b_p_vts_array) == 0
832-
&& tabstop_count(new_ts) == 1
833-
&& curbuf->b_p_ts == tabstop_first(new_ts))
831+
&& tabstop_count(new_vts_array) == 1
832+
&& curbuf->b_p_ts == tabstop_first(new_vts_array))
834833
; /* not changed */
835834
else if (tabstop_count(curbuf->b_p_vts_array) > 0
836-
&& tabstop_eq(curbuf->b_p_vts_array, new_ts))
835+
&& tabstop_eq(curbuf->b_p_vts_array, new_vts_array))
837836
; /* not changed */
838837
else
839838
redraw_curbuf_later(NOT_VALID);
@@ -853,20 +852,20 @@ ex_retab(exarg_T *eap)
853852
// than one tabstop then update 'vartabstop'.
854853
int *old_vts_ary = curbuf->b_p_vts_array;
855854

856-
if (tabstop_count(old_vts_ary) > 0 || tabstop_count(new_ts) > 1)
855+
if (tabstop_count(old_vts_ary) > 0 || tabstop_count(new_vts_array) > 1)
857856
{
858857
set_string_option_direct((char_u *)"vts", -1, new_ts_str,
859858
OPT_FREE|OPT_LOCAL, 0);
860859
vim_free(new_ts_str);
861-
curbuf->b_p_vts_array = new_ts;
860+
curbuf->b_p_vts_array = new_vts_array;
862861
vim_free(old_vts_ary);
863862
}
864863
else
865864
{
866865
// 'vartabstop' wasn't in use and a single value was given to
867866
// retab then update 'tabstop'.
868-
curbuf->b_p_ts = tabstop_first(new_ts);
869-
vim_free(new_ts);
867+
curbuf->b_p_ts = tabstop_first(new_vts_array);
868+
vim_free(new_vts_array);
870869
}
871870
}
872871
#else

src/option.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12844,7 +12844,7 @@ tabstop_start(colnr_T col, int ts, int *vts)
1284412844
int t;
1284512845
int excess;
1284612846

12847-
if (vts == 0 || vts[0] == 0)
12847+
if (vts == NULL || vts[0] == 0)
1284812848
return (col / ts) * ts;
1284912849

1285012850
tabcount = vts[0];
@@ -12878,10 +12878,11 @@ tabstop_fromto(
1287812878
int tabcount;
1287912879
int t;
1288012880

12881-
if (vts == 0 || vts[0] == 0)
12881+
if (vts == NULL || vts[0] == 0)
1288212882
{
1288312883
int tabs = 0;
1288412884
int initspc = ts - (start_col % ts);
12885+
1288512886
if (spaces >= initspc)
1288612887
{
1288712888
spaces -= initspc;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,8 @@ static char *(features[]) =
789789

790790
static int included_patches[] =
791791
{ /* Add new patch number below this line */
792+
/**/
793+
114,
792794
/**/
793795
113,
794796
/**/

0 commit comments

Comments
 (0)