Fix tag width calculation for multi-column chars
commit361fa80ebac966c1789b67b14fcfe550e45dfc62
authorYasushi SHOJI <yashi@atmark-techno.com>
Tue, 31 May 2016 07:25:42 +0000 (31 16:25 +0900)
committerNicolas Goaziou <mail@nicolasgoaziou.fr>
Thu, 2 Jun 2016 11:31:09 +0000 (2 13:31 +0200)
treecbc590b36931e1a17558f578701a7ee4a0f6f058
parent1f3d72e8b450172218b728b57004837db5d1f1ee
Fix tag width calculation for multi-column chars

* lisp/org.el (org-align-tags-here): Fix tag width calculation for
  multi-column chars.

Some characters have multiple column width.  Calculating string width
with points gives a wrong value than actual display width.  Use
`string-width' instead.

Here is an ECM for this problem.  `M-x org-update-statistics-cookies` or
`C-c #` on bar moves the tag on the headline.

* foo [0/0] :abc:
** child
* bar [0/0]      :日本語:
** child
12345678901234567890123456789012345678901234567890123456789012345678901234567890
         1         2         3         4         5         6         7         8
lisp/org.el