nvie / vim-rst-tables

Easily create and reformat your RST (reStructuredText) tables as you change cell content.
121 stars 36 forks source link

make padding correct when it contains CJK character #26

Open ch-linghu opened 8 years ago

ch-linghu commented 8 years ago

with this new method

Chinese string padding result:

 +--------+--------+--------+
 | 列1    | 列2    | 列3    |
 +========+========+========+
 | 单元11 | 单元12 | 单元13 |
 +--------+--------+--------+
 | 单元21 | 单元22 | 单元23 |
 +--------+--------+--------+
 | 单元31 | 单元32 | 单元33 |
 +--------+--------+--------+

(NOTE: it may look strange but the number of spaces are correct)

English string padding result:

   +--------+----------+------+
   | nombre | apellido | edad |
   +========+==========+======+
   | pepe   | zarate   | 28   |
   +--------+----------+------+
   | toto   | garcia   | 29   |
   +--------+----------+------+