@@ -3922,7 +3922,6 @@ get_buffer_info(buf_T *buf)
3922
3922
{
3923
3923
dict_T * dict ;
3924
3924
dict_T * opts ;
3925
- dict_T * vars ;
3926
3925
tabpage_T * tp ;
3927
3926
win_T * wp ;
3928
3927
list_T * windows ;
@@ -3943,10 +3942,8 @@ get_buffer_info(buf_T *buf)
3943
3942
buf -> b_ml .ml_mfp != NULL && buf -> b_nwindows == 0 ,
3944
3943
NULL );
3945
3944
3946
- /* Copy buffer variables */
3947
- vars = dict_copy (buf -> b_vars , TRUE, 0 );
3948
- if (vars != NULL )
3949
- dict_add_dict (dict , "variables" , vars );
3945
+ /* Get a reference to buffer variables */
3946
+ dict_add_dict (dict , "variables" , buf -> b_vars );
3950
3947
3951
3948
/* Copy buffer options */
3952
3949
opts = get_winbuf_options (TRUE);
@@ -4994,7 +4991,6 @@ get_tabpage_info(tabpage_T *tp, int tp_idx)
4994
4991
{
4995
4992
win_T * wp ;
4996
4993
dict_T * dict ;
4997
- dict_T * vars ;
4998
4994
list_T * l ;
4999
4995
5000
4996
dict = dict_alloc ();
@@ -5012,10 +5008,8 @@ get_tabpage_info(tabpage_T *tp, int tp_idx)
5012
5008
dict_add_list (dict , "windows" , l );
5013
5009
}
5014
5010
5015
- /* Copy tabpage variables */
5016
- vars = dict_copy (tp -> tp_vars , TRUE, 0 );
5017
- if (vars != NULL )
5018
- dict_add_dict (dict , "variables" , vars );
5011
+ /* Make a reference to tabpage variables */
5012
+ dict_add_dict (dict , "variables" , tp -> tp_vars );
5019
5013
5020
5014
return dict ;
5021
5015
}
@@ -5118,7 +5112,6 @@ f_gettabwinvar(typval_T *argvars, typval_T *rettv)
5118
5112
get_win_info (win_T * wp , short tpnr , short winnr )
5119
5113
{
5120
5114
dict_T * dict ;
5121
- dict_T * vars ;
5122
5115
dict_T * opts ;
5123
5116
5124
5117
dict = dict_alloc ();
@@ -5138,10 +5131,8 @@ get_win_info(win_T *wp, short tpnr, short winnr)
5138
5131
(bt_quickfix (wp -> w_buffer ) && wp -> w_llist_ref != NULL ), NULL );
5139
5132
#endif
5140
5133
5141
- /* Copy window variables */
5142
- vars = dict_copy (wp -> w_vars , TRUE, 0 );
5143
- if (vars != NULL )
5144
- dict_add_dict (dict , "variables" , vars );
5134
+ /* Make a reference to window variables */
5135
+ dict_add_dict (dict , "variables" , wp -> w_vars );
5145
5136
5146
5137
/* Copy window options */
5147
5138
opts = get_winbuf_options (FALSE);
0 commit comments