When set b:browsefilter, "browse e" show fileselection dialog. If using 
multibyte characters in b:browsefilter, it don't work correctly.
Currently, it is manipulated as single bytes.

Patch is here: https://gist.github.com/1630594 (raw: 
https://raw.github.com/gist/1630594/gistfile1.diff)

This patch is written by MURAOKA Taro.
Please check and include.

diff -r 0dabc2ce136c src/gui_w48.c
--- a/src/gui_w48.c Tue Jan 10 22:31:32 2012 +0100
+++ b/src/gui_w48.c Wed Jan 18 12:02:27 2012 +0900
@@ -328,6 +328,10 @@
 static LRESULT _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData);
 #endif
 
+#if defined(FEAT_MBYTE) && defined(WIN3264)
+static char_u * convert_filter(char_u *s);
+#endif
+
 #ifdef DEBUG_PRINT_ERROR
 /*
  * Print out the last Windows error message
@@ -3275,28 +3279,21 @@
 
 # if defined(FEAT_MBYTE) && defined(WIN3264)
 /*
- * Wide version of convert_filter().  Keep in sync!
+ * Wide version of convert_filter(). Keep in sync!
  */
     static WCHAR *
 convert_filterW(char_u *s)
 {
     WCHAR *res;
-    unsigned s_len = (unsigned)STRLEN(s);
-    unsigned i;
-
-    res = (WCHAR *)alloc((s_len + 3) * sizeof(WCHAR));
-    if (res != NULL)
-    {
- for (i = 0; i < s_len; ++i)
-    if (s[i] == '\t' || s[i] == '\n')
- res[i] = '\0';
-    else
- res[i] = s[i];
- res[s_len] = NUL;
- /* Add two extra NULs to make sure it's properly terminated. */
- res[s_len + 1] = NUL;
- res[s_len + 2] = NUL;
-    }
+    char_u *tmp;
+    int len;
+
+    tmp = convert_filter(s);
+    if (tmp == NULL)
+ return NULL;
+    len = (int)STRLEN(s) + 3;
+    res = enc_to_utf16(tmp, &len);
+    vim_free(tmp);
     return res;
 }
 

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui