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)
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 7639af8..923a750 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -1953,6 +1953,8 @@
 			ret_string,	    f_getbufoneline},
     {"getbufvar",	2, 3, FEARG_1,	    arg3_buffer_string_any,
 			ret_any,	    f_getbufvar},
+    {"getcellwidths",	0, 0, 0,	    NULL,
+			ret_list_any,	    f_getcellwidths},
     {"getchangelist",	0, 1, FEARG_1,	    arg1_buffer,
 			ret_list_any,	    f_getchangelist},
     {"getchar",		0, 1, 0,	    arg1_bool,
diff --git a/src/mbyte.c b/src/mbyte.c
index 07cd9c6..4f6c850 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -5746,6 +5746,25 @@
 }
 
     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)
 {
     if (check_for_string_arg(argvars, 0) == FAIL
diff --git a/src/proto/mbyte.pro b/src/proto/mbyte.pro
index c429adc..1bd3aa0 100644
--- a/src/proto/mbyte.pro
+++ b/src/proto/mbyte.pro
@@ -86,5 +86,6 @@
 char_u *string_convert(vimconv_T *vcp, char_u *ptr, int *lenp);
 char_u *string_convert_ext(vimconv_T *vcp, char_u *ptr, int *lenp, int *unconvlenp);
 void f_setcellwidths(typval_T *argvars, typval_T *rettv);
+void f_getcellwidths(typval_T *argvars, typval_T *rettv);
 void f_charclass(typval_T *argvars, typval_T *rettv);
 /* vim: set ft=c : */
diff --git a/src/testdir/test_utf8.vim b/src/testdir/test_utf8.vim
index 935af7e..d71d7ad 100644
--- a/src/testdir/test_utf8.vim
+++ b/src/testdir/test_utf8.vim
@@ -199,6 +199,26 @@
   call setcellwidths([])
 endfunc
 
+func Test_getcellwidths()
+  call setcellwidths([])
+  call assert_equal([], getcellwidths())
+
+  let widthlist = [
+        \ [0x1330, 0x1330, 2],
+        \ [9999, 10000, 1],
+        \ [0x1337, 0x1339, 2],
+        \]
+  let widthlistsorted = [
+        \ [0x1330, 0x1330, 2],
+        \ [0x1337, 0x1339, 2],
+        \ [9999, 10000, 1],
+        \]
+  call setcellwidths(widthlist)
+  call assert_equal(widthlistsorted, getcellwidths())
+
+  call setcellwidths([])
+endfunc
+
 func Test_setcellwidths_dump()
   CheckRunVimInTerminal
 
diff --git a/src/version.c b/src/version.c
index a388019..3496b3a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1212,
+/**/
     1211,
 /**/
     1210,