mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
commit
c3e4e0e383
@ -1414,7 +1414,6 @@ buflist_new (
|
||||
return NULL;
|
||||
if (aborting()) /* autocmds may abort script processing */
|
||||
return NULL;
|
||||
/* buf->b_nwindows = 0; why was this here? */
|
||||
free_buffer_stuff(buf, FALSE); /* delete local variables et al. */
|
||||
|
||||
/* Init the options. */
|
||||
@ -1475,6 +1474,9 @@ buflist_new (
|
||||
fmarks_check_names(buf); /* check file marks for this file */
|
||||
buf->b_p_bl = (flags & BLN_LISTED) ? TRUE : FALSE; /* init 'buflisted' */
|
||||
if (!(flags & BLN_DUMMY)) {
|
||||
// Tricky: these autocommands may change the buffer list. They could also
|
||||
// split the window with re-using the one empty buffer. This may result in
|
||||
// unexpectedly losing the empty buffer.
|
||||
apply_autocmds(EVENT_BUFNEW, NULL, NULL, FALSE, buf);
|
||||
if (!buf_valid(buf)) {
|
||||
return NULL;
|
||||
|
@ -2112,7 +2112,6 @@ do_ecmd (
|
||||
goto theend;
|
||||
if (buf->b_ml.ml_mfp == NULL) { /* no memfile yet */
|
||||
oldbuf = FALSE;
|
||||
buf->b_nwindows = 0;
|
||||
} else { /* existing memfile */
|
||||
oldbuf = TRUE;
|
||||
(void)buf_check_timestamp(buf, FALSE);
|
||||
@ -2138,7 +2137,7 @@ do_ecmd (
|
||||
* Make the (new) buffer the one used by the current window.
|
||||
* If the old buffer becomes unused, free it if ECMD_HIDE is FALSE.
|
||||
* If the current buffer was empty and has no file name, curbuf
|
||||
* is returned by buflist_new().
|
||||
* is returned by buflist_new(), nothing to do here.
|
||||
*/
|
||||
if (buf != curbuf) {
|
||||
/*
|
||||
@ -2225,8 +2224,7 @@ do_ecmd (
|
||||
}
|
||||
xfree(new_name);
|
||||
au_new_curbuf = NULL;
|
||||
} else
|
||||
++curbuf->b_nwindows;
|
||||
}
|
||||
|
||||
curwin->w_pcmark.lnum = 1;
|
||||
curwin->w_pcmark.col = 0;
|
||||
|
@ -351,7 +351,7 @@ static int included_patches[] = {
|
||||
// 648 NA
|
||||
// 647 NA
|
||||
646,
|
||||
// 645,
|
||||
645,
|
||||
// 644 NA
|
||||
// 643,
|
||||
// 642,
|
||||
|
Loading…
Reference in New Issue
Block a user