diff options
author | Bram Moolenaar <bram@vim.org> | 2013-09-08 16:03:45 +0200 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2013-09-08 16:03:45 +0200 |
commit | 0ac106feed7aee5e9c7a6a177e88dfba99558a81 (patch) | |
tree | 1926a669166dfa2e4da6e2123612024044fc70f2 | |
parent | 118f0a1d4c90979f6f5076b02fa1f6195f2c0452 (diff) | |
download | vim-0ac106feed7aee5e9c7a6a177e88dfba99558a81.tar.gz |
Problem: Reading before start of a string.
Solution: Do not call mb_ptr_back() at start of a string. (Dominique Pelle)
-rw-r--r-- | src/edit.c | 8 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 7 insertions, 3 deletions
@@ -5187,11 +5187,13 @@ ins_complete(c) /* Go back to just before the first filename character. */ mb_ptr_back(line, p); - while (vim_isfilec(PTR2CHAR(p)) && p >= line) + while (p > line && vim_isfilec(PTR2CHAR(p))) mb_ptr_back(line, p); - startcol = (int)(p - line); + startcol = (int)(p - line) + 1; + if (p == line && vim_isfilec(PTR2CHAR(p))) + startcol = 0; - compl_col += ++startcol; + compl_col += startcol; compl_length = (int)curs_col - startcol; compl_pattern = addstar(line + compl_col, compl_length, EXPAND_FILES); diff --git a/src/version.c b/src/version.c index 9731f70c..ff4e3bb6 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 */ /**/ + 25, +/**/ 24, /**/ 23, |