summaryrefslogtreecommitdiff
path: root/src/netbeans.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/netbeans.c')
-rw-r--r--src/netbeans.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/netbeans.c b/src/netbeans.c
index e326af8f3..736bb16b0 100644
--- a/src/netbeans.c
+++ b/src/netbeans.c
@@ -2177,10 +2177,15 @@ nb_do_cmd(
#endif
)
{
+#ifdef FEAT_AUTOCMD
+ bufref_T bufref;
+
+ set_bufref(&bufref, buf->bufp);
+#endif
buf_write_all(buf->bufp, FALSE);
#ifdef FEAT_AUTOCMD
/* an autocommand may have deleted the buffer */
- if (!buf_valid(buf->bufp))
+ if (!bufref_valid(&bufref))
buf->bufp = NULL;
#endif
}