From 0300e465aa9b034455f2c98d9996d5a3b04e9900 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 8 Sep 2013 16:03:45 +0200 Subject: [PATCH] updated for version 7.4.025 Problem: Reading before start of a string. Solution: Do not call mb_ptr_back() at start of a string. (Dominique Pelle) --- src/edit.c | 8 +++++--- src/version.c | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/edit.c b/src/edit.c index 98737ece6..b2b778729 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); diff --git a/src/version.c b/src/version.c index 9731f70c7..ff4e3bb6f 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 25, /**/ 24, /**/ -- 2.50.1