diff options
author | Bram Moolenaar <bram@vim.org> | 2013-09-05 13:50:53 +0200 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2013-09-05 13:50:53 +0200 |
commit | 4f71fdbd2fb2aeb4110a622f86ee8c660078c7d8 (patch) | |
tree | 7ac9210aee916655c7070ac20fd90e1061dbaa6f | |
parent | d2a09ee60edd3f522683903942eb67c873b5ddf5 (diff) | |
download | vim-7.4.019.tar.gz |
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)
-rw-r--r-- | src/edit.c | 10 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 10 insertions, 2 deletions
@@ -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, diff --git a/src/version.c b/src/version.c index abed9454..0e6dc1c8 100644 --- a/src/version.c +++ b/src/version.c @@ -739,6 +739,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 19, +/**/ 18, /**/ 17, |