From 9999e5698d50b384eb95181ef06db4cc99c90bb2 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 10 Apr 2013 18:54:01 +0200 Subject: Use the buffer manager to delete buffer, throw when a client is inserting --- src/client_manager.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/client_manager.cc') diff --git a/src/client_manager.cc b/src/client_manager.cc index 6db8afd4..d651a057 100644 --- a/src/client_manager.cc +++ b/src/client_manager.cc @@ -138,6 +138,10 @@ void ClientManager::ensure_no_client_uses_buffer(Buffer& buffer) if (&client->context().buffer() != &buffer) continue; + if (client->context().editor().is_editing()) + throw runtime_error("client '" + client->name + "' is inserting in '" + + buffer.display_name() + '\''); + // change client context to edit the first buffer which is not the // specified one. As BufferManager stores buffer according to last // access, this selects a sensible buffer to display. -- cgit v1.2.3