aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 6dd71e92a6..f23a1caf8b 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -76,6 +76,7 @@
#include "nvim/syntax.h"
#include "nvim/ui.h"
#include "nvim/undo.h"
+#include "nvim/usercmd.h"
#include "nvim/version.h"
#include "nvim/vim.h"
#include "nvim/window.h"
@@ -968,7 +969,7 @@ char *do_bufdel(int command, char *arg, int addr_count, int start_bnr, int end_b
} else {
if (addr_count == 2) {
if (*arg) { // both range and argument is not allowed
- return _(e_trailing);
+ return ex_errmsg(e_trailing_arg, arg);
}
bnr = start_bnr;
} else { // addr_count == 1
@@ -5639,7 +5640,9 @@ void wipe_buffer(buf_T *buf, bool aucmd)
void buf_open_scratch(handle_T bufnr, char *bufname)
{
(void)do_ecmd((int)bufnr, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL);
+ apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, false, curbuf);
(void)setfname(curbuf, bufname, NULL, true);
+ apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, false, curbuf);
set_option_value("bh", 0L, "hide", OPT_LOCAL);
set_option_value("bt", 0L, "nofile", OPT_LOCAL);
set_option_value("swf", 0L, NULL, OPT_LOCAL);