summaryrefslogtreecommitdiff
path: root/src/edit.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-09-05 13:50:53 +0200
committerBram Moolenaar <Bram@vim.org>2013-09-05 13:50:53 +0200
commit00b764aa4115271aa553c8443adc6cec6859e69e (patch)
treee9d37e257cfadc43d8c54dfc06b469462b601ae7 /src/edit.c
parentf0d9e005375409a9f3a887a1a946afb9a45cdd34 (diff)
downloadvim-00b764aa4115271aa553c8443adc6cec6859e69e.zip
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)
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/edit.c b/src/edit.c
index 6f8dc49a3..0c6089b68 100644
--- 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,