mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.1.0114: confusing variable name
Problem: Confusing variable name. Solution: Rename new_ts to new_vts_array. Change zero to NULL.
This commit is contained in:
parent
675e8d6adb
commit
0119a59ffd
@ -678,7 +678,7 @@ ex_retab(exarg_T *eap)
|
|||||||
char_u *new_line = (char_u *)1; /* init to non-NULL */
|
char_u *new_line = (char_u *)1; /* init to non-NULL */
|
||||||
int did_undo; /* called u_save for current line */
|
int did_undo; /* called u_save for current line */
|
||||||
#ifdef FEAT_VARTABS
|
#ifdef FEAT_VARTABS
|
||||||
int *new_ts = 0;
|
int *new_vts_array = NULL;
|
||||||
char_u *new_ts_str; /* string value of tab argument */
|
char_u *new_ts_str; /* string value of tab argument */
|
||||||
#else
|
#else
|
||||||
int temp;
|
int temp;
|
||||||
@ -693,16 +693,17 @@ ex_retab(exarg_T *eap)
|
|||||||
|
|
||||||
#ifdef FEAT_VARTABS
|
#ifdef FEAT_VARTABS
|
||||||
new_ts_str = eap->arg;
|
new_ts_str = eap->arg;
|
||||||
if (!tabstop_set(eap->arg, &new_ts))
|
if (!tabstop_set(eap->arg, &new_vts_array))
|
||||||
return;
|
return;
|
||||||
while (vim_isdigit(*(eap->arg)) || *(eap->arg) == ',')
|
while (vim_isdigit(*(eap->arg)) || *(eap->arg) == ',')
|
||||||
++(eap->arg);
|
++(eap->arg);
|
||||||
|
|
||||||
// This ensures that either new_ts and new_ts_str are freshly allocated,
|
// This ensures that either new_vts_array and new_ts_str are freshly
|
||||||
// or new_ts points to an existing array and new_ts_str is null.
|
// allocated, or new_vts_array points to an existing array and new_ts_str
|
||||||
if (new_ts == 0)
|
// is null.
|
||||||
|
if (new_vts_array == NULL)
|
||||||
{
|
{
|
||||||
new_ts = curbuf->b_p_vts_array;
|
new_vts_array = curbuf->b_p_vts_array;
|
||||||
new_ts_str = NULL;
|
new_ts_str = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -753,9 +754,7 @@ ex_retab(exarg_T *eap)
|
|||||||
int t, s;
|
int t, s;
|
||||||
|
|
||||||
tabstop_fromto(start_vcol, vcol,
|
tabstop_fromto(start_vcol, vcol,
|
||||||
tabstop_count(new_ts)? 0: curbuf->b_p_ts,
|
curbuf->b_p_ts, new_vts_array, &t, &s);
|
||||||
new_ts,
|
|
||||||
&t, &s);
|
|
||||||
num_tabs = t;
|
num_tabs = t;
|
||||||
num_spaces = s;
|
num_spaces = s;
|
||||||
#else
|
#else
|
||||||
@ -829,11 +828,11 @@ ex_retab(exarg_T *eap)
|
|||||||
// If a single value was given then it can be considered equal to
|
// If a single value was given then it can be considered equal to
|
||||||
// either the value of 'tabstop' or the value of 'vartabstop'.
|
// either the value of 'tabstop' or the value of 'vartabstop'.
|
||||||
if (tabstop_count(curbuf->b_p_vts_array) == 0
|
if (tabstop_count(curbuf->b_p_vts_array) == 0
|
||||||
&& tabstop_count(new_ts) == 1
|
&& tabstop_count(new_vts_array) == 1
|
||||||
&& curbuf->b_p_ts == tabstop_first(new_ts))
|
&& curbuf->b_p_ts == tabstop_first(new_vts_array))
|
||||||
; /* not changed */
|
; /* not changed */
|
||||||
else if (tabstop_count(curbuf->b_p_vts_array) > 0
|
else if (tabstop_count(curbuf->b_p_vts_array) > 0
|
||||||
&& tabstop_eq(curbuf->b_p_vts_array, new_ts))
|
&& tabstop_eq(curbuf->b_p_vts_array, new_vts_array))
|
||||||
; /* not changed */
|
; /* not changed */
|
||||||
else
|
else
|
||||||
redraw_curbuf_later(NOT_VALID);
|
redraw_curbuf_later(NOT_VALID);
|
||||||
@ -853,20 +852,20 @@ ex_retab(exarg_T *eap)
|
|||||||
// than one tabstop then update 'vartabstop'.
|
// than one tabstop then update 'vartabstop'.
|
||||||
int *old_vts_ary = curbuf->b_p_vts_array;
|
int *old_vts_ary = curbuf->b_p_vts_array;
|
||||||
|
|
||||||
if (tabstop_count(old_vts_ary) > 0 || tabstop_count(new_ts) > 1)
|
if (tabstop_count(old_vts_ary) > 0 || tabstop_count(new_vts_array) > 1)
|
||||||
{
|
{
|
||||||
set_string_option_direct((char_u *)"vts", -1, new_ts_str,
|
set_string_option_direct((char_u *)"vts", -1, new_ts_str,
|
||||||
OPT_FREE|OPT_LOCAL, 0);
|
OPT_FREE|OPT_LOCAL, 0);
|
||||||
vim_free(new_ts_str);
|
vim_free(new_ts_str);
|
||||||
curbuf->b_p_vts_array = new_ts;
|
curbuf->b_p_vts_array = new_vts_array;
|
||||||
vim_free(old_vts_ary);
|
vim_free(old_vts_ary);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 'vartabstop' wasn't in use and a single value was given to
|
// 'vartabstop' wasn't in use and a single value was given to
|
||||||
// retab then update 'tabstop'.
|
// retab then update 'tabstop'.
|
||||||
curbuf->b_p_ts = tabstop_first(new_ts);
|
curbuf->b_p_ts = tabstop_first(new_vts_array);
|
||||||
vim_free(new_ts);
|
vim_free(new_vts_array);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -12844,7 +12844,7 @@ tabstop_start(colnr_T col, int ts, int *vts)
|
|||||||
int t;
|
int t;
|
||||||
int excess;
|
int excess;
|
||||||
|
|
||||||
if (vts == 0 || vts[0] == 0)
|
if (vts == NULL || vts[0] == 0)
|
||||||
return (col / ts) * ts;
|
return (col / ts) * ts;
|
||||||
|
|
||||||
tabcount = vts[0];
|
tabcount = vts[0];
|
||||||
@ -12878,10 +12878,11 @@ tabstop_fromto(
|
|||||||
int tabcount;
|
int tabcount;
|
||||||
int t;
|
int t;
|
||||||
|
|
||||||
if (vts == 0 || vts[0] == 0)
|
if (vts == NULL || vts[0] == 0)
|
||||||
{
|
{
|
||||||
int tabs = 0;
|
int tabs = 0;
|
||||||
int initspc = ts - (start_col % ts);
|
int initspc = ts - (start_col % ts);
|
||||||
|
|
||||||
if (spaces >= initspc)
|
if (spaces >= initspc)
|
||||||
{
|
{
|
||||||
spaces -= initspc;
|
spaces -= initspc;
|
||||||
|
@ -789,6 +789,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
114,
|
||||||
/**/
|
/**/
|
||||||
113,
|
113,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user