diff src/edit.c @ 5332:d5eb32dc231c v7.4.019

updated for version 7.4.019 Problem: MS-Windows: File name completion doesn't work properly with Chinese characters. (Yue Wu) Solution: Take care of multi-byte characters when looking for the start of the file name. (Ken Takata)
author Bram Moolenaar <bram@vim.org>
date Thu, 05 Sep 2013 13:50:53 +0200
parents 460d5be9395e
children 09361f13580b
line wrap: on
line diff
--- a/src/edit.c
+++ b/src/edit.c
@@ -5183,8 +5183,14 @@ ins_complete(c)
 	}
 	else if (ctrl_x_mode == CTRL_X_FILES)
 	{
-	    while (--startcol >= 0 && vim_isfilec(line[startcol]))
-		;
+	    char_u	*p = line + startcol;
+
+	    /* Go back to just before the first filename character. */
+	    mb_ptr_back(line, p);
+	    while (vim_isfilec(PTR2CHAR(p)) && p >= line)
+		mb_ptr_back(line, p);
+	    startcol = p - line;
+
 	    compl_col += ++startcol;
 	    compl_length = (int)curs_col - startcol;
 	    compl_pattern = addstar(line + compl_col, compl_length,