From 3d2d44037f27104207005998d9bcb55af1152892 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 21 Aug 2015 13:10:34 -0300 Subject: terminal: Only wipe buffer terminal_close wasn't called After @250aca4f8938 it is possible that terminal_close will be called without invoking the close_cb(which normally destroys the terminal structure). If this happens, the terminal buffer will already be deleted so there's no need to call `bwipeout!`. --- src/nvim/terminal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index eb010bc190..931105717b 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -423,7 +423,9 @@ end: ui_busy_stop(); if (close) { term->opts.close_cb(term->opts.data); - do_cmdline_cmd("bwipeout!"); + if (term->buf) { + do_cmdline_cmd("bwipeout!"); + } } } -- cgit