From bf5bd3ea369abf30ddcfec84c90ae969164a4ce5 Mon Sep 17 00:00:00 2001 From: Michael J Gruber <github@grubix.eu> Date: Fri, 16 Oct 2020 18:07:54 +0200 Subject: [PATCH] allow to open multiple buffers of the same type We actively prevent opening multiple taglist or bufferlist buffers, but so far allow to open multiple named query buffers. They cannot differ, though, since there is nothing to configure about them. Rather than confusing the user by behaving differently for different buffer types, lift the restriction for all of them: at worst there are multiple instances of buffers with the same content. We do make a single exception for the bufferlist buffer because that is the one you typically use to switch to other buffers. --- alot/commands/globals.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/alot/commands/globals.py b/alot/commands/globals.py index bfda1762b..beb2fe98c 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -566,14 +566,7 @@ def __init__(self, filtfun=lambda x: x, tags=None, **kwargs): def apply(self, ui): tags = self.tags or ui.dbman.get_all_tags() - blists = ui.get_buffers_of_type(buffers.TagListBuffer) - if blists: - buf = blists[0] - buf.tags = tags - buf.rebuild() - ui.buffer_focus(buf) - else: - ui.buffer_open(buffers.TagListBuffer(ui, tags, self.filtfun)) + ui.buffer_open(buffers.TagListBuffer(ui, tags, self.filtfun)) @registerCommand(MODE, 'namedqueries')