delete buffer if needed when creating a scratch buffer

This commit is contained in:
Maxime Coste 2013-04-11 23:09:17 +02:00
parent dcc054a785
commit 1b5760f1a1

View File

@ -101,7 +101,10 @@ void edit(const CommandParameters& params, Context& context)
if (not buffer) if (not buffer)
{ {
if (parser.has_option("scratch")) if (parser.has_option("scratch"))
{
BufferManager::instance().delete_buffer_if_exists(name);
buffer = new Buffer(name, Buffer::Flags::None); buffer = new Buffer(name, Buffer::Flags::None);
}
else if (parser.has_option("fifo")) else if (parser.has_option("fifo"))
buffer = open_fifo(name, parser.option_value("fifo"), context); buffer = open_fifo(name, parser.option_value("fifo"), context);
else else