0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

updated for version 7.3.1054

Problem:    Can't build without the +autocmd feature. (Elimar Riesebieter)
Solution:   Fix use of buf and curbuf.
This commit is contained in:
Bram Moolenaar
2013-05-30 11:43:15 +02:00
parent 07b8864111
commit 7e28384a9a
4 changed files with 20 additions and 17 deletions

View File

@@ -2421,10 +2421,11 @@ rename_buffer(new_fname)
char_u *new_fname; char_u *new_fname;
{ {
char_u *fname, *sfname, *xfname; char_u *fname, *sfname, *xfname;
#ifdef FEAT_AUTOCMD buf_T *buf;
buf_T *buf = curbuf;
apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, buf); #ifdef FEAT_AUTOCMD
buf = curbuf;
apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
/* buffer changed, don't change name now */ /* buffer changed, don't change name now */
if (buf != curbuf) if (buf != curbuf)
return FAIL; return FAIL;
@@ -2440,18 +2441,18 @@ rename_buffer(new_fname)
* But don't set the alternate file name if the buffer didn't have a * But don't set the alternate file name if the buffer didn't have a
* name. * name.
*/ */
fname = buf->b_ffname; fname = curbuf->b_ffname;
sfname = buf->b_sfname; sfname = curbuf->b_sfname;
xfname = buf->b_fname; xfname = curbuf->b_fname;
buf->b_ffname = NULL; curbuf->b_ffname = NULL;
buf->b_sfname = NULL; curbuf->b_sfname = NULL;
if (setfname(buf, new_fname, NULL, TRUE) == FAIL) if (setfname(curbuf, new_fname, NULL, TRUE) == FAIL)
{ {
buf->b_ffname = fname; curbuf->b_ffname = fname;
buf->b_sfname = sfname; curbuf->b_sfname = sfname;
return FAIL; return FAIL;
} }
buf->b_flags |= BF_NOTEDITED; curbuf->b_flags |= BF_NOTEDITED;
if (xfname != NULL && *xfname != NUL) if (xfname != NULL && *xfname != NUL)
{ {
buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0); buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0);
@@ -2461,7 +2462,7 @@ rename_buffer(new_fname)
vim_free(fname); vim_free(fname);
vim_free(sfname); vim_free(sfname);
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, buf); apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
#endif #endif
/* Change directories when the 'acd' option is set. */ /* Change directories when the 'acd' option is set. */
DO_AUTOCHDIR DO_AUTOCHDIR

View File

@@ -320,13 +320,13 @@ Second line
Third line Third line
foo foo
1:BufFilePre:1 1:BufFilePre:1
6:BufFilePost:1 1:BufFilePost:1
testdir/foo testdir/foo
5:BufFilePre:5 5:BufFilePre:5
5:BufFilePost:5 5:BufFilePost:5
testdir/bar testdir/bar
1:BufFilePre:1 1:BufFilePre:1
7:BufFilePost:1 1:BufFilePost:1
testdir/test86.in testdir/test86.in
valid: b:False, cb:True valid: b:False, cb:True
i:<buffer test86.in> i:<buffer test86.in>

View File

@@ -309,13 +309,13 @@ Second line
Third line Third line
foo foo
1:BufFilePre:1 1:BufFilePre:1
6:BufFilePost:1 1:BufFilePost:1
testdir/foo testdir/foo
5:BufFilePre:5 5:BufFilePre:5
5:BufFilePost:5 5:BufFilePost:5
testdir/bar testdir/bar
1:BufFilePre:1 1:BufFilePre:1
7:BufFilePost:1 1:BufFilePost:1
testdir/test87.in testdir/test87.in
valid: b:False, cb:True valid: b:False, cb:True
i:<buffer test87.in> i:<buffer test87.in>

View File

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