From 1b5760f1a142a88b2df82963dc09ed3f60a9461e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 11 Apr 2013 23:09:17 +0200 Subject: [PATCH] delete buffer if needed when creating a scratch buffer --- src/commands.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/commands.cc b/src/commands.cc index 68f7bdfd..15409b08 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -101,7 +101,10 @@ void edit(const CommandParameters& params, Context& context) if (not buffer) { if (parser.has_option("scratch")) + { + BufferManager::instance().delete_buffer_if_exists(name); buffer = new Buffer(name, Buffer::Flags::None); + } else if (parser.has_option("fifo")) buffer = open_fifo(name, parser.option_value("fifo"), context); else