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:
committed by
Bram Moolenaar
parent
f7d1c6e188
commit
66bb9ae70f
19
src/mbyte.c
19
src/mbyte.c
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user