Skip to content

Instantly share code, notes, and snippets.

@mattn
Last active December 18, 2015 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/5863733 to your computer and use it in GitHub Desktop.
Save mattn/5863733 to your computer and use it in GitHub Desktop.
diff -r 5759342cde79 src/gui_w32.c
--- a/src/gui_w32.c Mon Jun 24 22:33:30 2013 +0200
+++ b/src/gui_w32.c Wed Jun 26 09:33:08 2013 +0900
@@ -3216,7 +3216,7 @@
if (l == 1 && vim_iswhite(*pend)
&& textWidth > maxDialogWidth * 3 / 4)
last_white = pend;
- textWidth += GetTextWidth(hdc, pend, l);
+ textWidth += GetTextWidthEnc(hdc, pend, l);
if (textWidth >= maxDialogWidth)
{
/* Line will wrap. */
@@ -3282,7 +3282,7 @@
pend = vim_strchr(pstart, DLG_BUTTON_SEP);
if (pend == NULL)
pend = pstart + STRLEN(pstart); // Last button name.
- textWidth = GetTextWidth(hdc, pstart, (int)(pend - pstart));
+ textWidth = GetTextWidthEnc(hdc, pstart, (int)(pend - pstart));
if (textWidth < minButtonWidth)
textWidth = minButtonWidth;
textWidth += dlgPaddingX; /* Padding within button */
@@ -3307,7 +3307,7 @@
pend = vim_strchr(pstart, DLG_BUTTON_SEP);
if (pend == NULL)
pend = pstart + STRLEN(pstart); // Last button name.
- textWidth = GetTextWidth(hdc, pstart, (int)(pend - pstart));
+ textWidth = GetTextWidthEnc(hdc, pstart, (int)(pend - pstart));
textWidth += dlgPaddingX; /* Padding within button */
textWidth += DLG_VERT_PADDING_X * 2; /* Padding around button */
if (textWidth > dlgwidth)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment