summaryrefslogtreecommitdiff
path: root/src/gui_mac.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-07-18 15:31:08 +0200
committerBram Moolenaar <Bram@vim.org>2010-07-18 15:31:08 +0200
commit72597a57b526a8df333e77ef8a837b595baa18c7 (patch)
tree8b635e3dbb23f92a0a73b730cc79bc538c0b61b9 /src/gui_mac.c
parent9855d6b3610b3ae46a5522b9f8e1e4b521759e83 (diff)
downloadvim-git-72597a57b526a8df333e77ef8a837b595baa18c7.tar.gz
Added strwidth() and strchars() functions.
Diffstat (limited to 'src/gui_mac.c')
-rw-r--r--src/gui_mac.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/gui_mac.c b/src/gui_mac.c
index f6aa22b57..2f0f7f865 100644
--- a/src/gui_mac.c
+++ b/src/gui_mac.c
@@ -3983,13 +3983,8 @@ draw_string_QD(int row, int col, char_u *s, int len, int flags)
/* Multibyte computation taken from gui_w32.c */
if (has_mbyte)
{
- int cell_len = 0;
- int n;
-
/* Compute the length in display cells. */
- for (n = 0; n < len; n += MB_BYTE2LEN(s[n]))
- cell_len += (*mb_ptr2cells)(s + n);
- rc.right = FILL_X(col + cell_len);
+ rc.right = FILL_X(col + mb_string2cells(s, len));
}
else
#endif
@@ -4087,13 +4082,8 @@ draw_string_ATSUI(int row, int col, char_u *s, int len, int flags)
/* Multibyte computation taken from gui_w32.c */
if (has_mbyte)
{
- int cell_len = 0;
- int n;
-
/* Compute the length in display cells. */
- for (n = 0; n < len; n += MB_BYTE2LEN(s[n]))
- cell_len += (*mb_ptr2cells)(s + n);
- rc.right = FILL_X(col + cell_len);
+ rc.right = FILL_X(col + mb_string2cells(s, len));
}
else
rc.right = FILL_X(col + len) + (col + len == Columns);