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 | 0300e465aa9b034455f2c98d9996d5a3b04e9900 (patch) | |
tree | 7617ce2797aeb4a4a64e4938384f1864b939e3b0 /src/edit.c | |
parent | 3b262393419ddf73e0bce95e0d896c46a95236d9 (diff) |
updated for version 7.4.025v7.4.025
Problem: Reading before start of a string.
Solution: Do not call mb_ptr_back() at start of a string. (Dominique Pelle)
Diffstat (limited to 'src/edit.c')
-rw-r--r-- | src/edit.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/edit.c b/src/edit.c index 98737ece65..b2b7787293 100644 --- a/src/edit.c +++ b/src/edit.c @@ -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); |