0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.4.027

Problem:    Another valgrind error when using CTRL-X CTRL-F at the start of
            the line. (Dominique Pelle)
Solution:   Don't call mb_ptr_back() at the start of the line.  Add a test.
This commit is contained in:
Bram Moolenaar
2013-09-08 20:00:48 +02:00
parent 95235e64d8
commit dd40734800
3 changed files with 16 additions and 7 deletions

View File

@@ -5182,16 +5182,20 @@ ins_complete(c)
return FAIL;
}
else if (ctrl_x_mode == CTRL_X_FILES)
{
/* Go back to just before the first filename character. */
if (startcol > 0)
{
char_u *p = line + startcol;
/* Go back to just before the first filename character. */
mb_ptr_back(line, p);
while (p > line && vim_isfilec(PTR2CHAR(p)))
mb_ptr_back(line, p);
startcol = (int)(p - line) + 1;
if (p == line && vim_isfilec(PTR2CHAR(p)))
startcol = 0;
else
startcol = (int)(p - line) + 1;
}
compl_col += startcol;
compl_length = (int)curs_col - startcol;

View File

@@ -36,6 +36,9 @@ kOM
:w Xtest11.one
:w Xtest11.two
OIXA
:" use CTRL-X CTRL-F to complete Xtest11.one, remove it and then use
:" CTRL-X CTRL-F again to verify this doesn't cause trouble.
OXddk
:se cpt=w
OST
:se cpt=u nohid

View File

@@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
27,
/**/
26,
/**/