diff options
-rw-r--r-- | src/fileio.c | 2 | ||||
-rw-r--r-- | src/testdir/test_autocmd.vim | 12 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/fileio.c b/src/fileio.c index 1b30e0fed5..8437b2b447 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -312,7 +312,7 @@ readfile( curbuf->b_op_start = orig_start; if (flags & READ_NOFILE) - return FAIL; + return NOTDONE; // so that BufEnter can be triggered } if ((shortmess(SHM_OVER) || curbuf->b_help) && p_verbose == 0) diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index c043a35311..4b0928517a 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -681,9 +681,19 @@ func Test_BufEnter() " On MS-Windows we can't edit the directory, make sure we wipe the right " buffer. bwipe! Xdir - call delete('Xdir', 'd') au! BufEnter + + " Editing a "nofile" buffer doesn't read the file but does trigger BufEnter + " for historic reasons. + new somefile + set buftype=nofile + au BufEnter somefile call setline(1, 'some text') + edit + call assert_equal('some text', getline(1)) + + bwipe! + au! BufEnter endfunc " Closing a window might cause an endless loop diff --git a/src/version.c b/src/version.c index 9590974685..e32f990bcb 100644 --- a/src/version.c +++ b/src/version.c @@ -724,6 +724,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 275, +/**/ 274, /**/ 273, |