1
0
forked from aniani/vim

patch 9.0.1212: cannot read back what setcellwidths() has done

Problem:    Cannot read back what setcellwidths() has done.
Solution:   Add getcellwidths(). (Kota Kato, closes #11837)
This commit is contained in:
Kota Kato
2023-01-17 18:31:56 +00:00
committed by Bram Moolenaar
parent f7d1c6e188
commit 66bb9ae70f
7 changed files with 54 additions and 1 deletions

View File

@@ -5745,6 +5745,25 @@ f_setcellwidths(typval_T *argvars, typval_T *rettv UNUSED)
redraw_all_later(UPD_CLEAR);
}
void
f_getcellwidths(typval_T *argvars UNUSED, typval_T *rettv)
{
if (rettv_list_alloc(rettv) == FAIL)
return;
for (size_t i = 0; i < cw_table_size; i++)
{
list_T *entry = list_alloc();
if (entry == NULL)
break;
list_append_number(entry, (varnumber_T)cw_table[i].first);
list_append_number(entry, (varnumber_T)cw_table[i].last);
list_append_number(entry, (varnumber_T)cw_table[i].width);
list_append_list(rettv->vval.v_list, entry);
}
}
void
f_charclass(typval_T *argvars, typval_T *rettv UNUSED)
{