@@ -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
0 commit comments