From e7b74c19a8954ebb6bb3315fe2a403f490f0b5bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 15 Jun 2020 16:04:37 +0200 Subject: plugins/reorder: Ignore gaptab when parsing as they're recreated automatically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- plugins/reorder.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/reorder.py b/plugins/reorder.py index 01de5c5d..4a5f515e 100644 --- a/plugins/reorder.py +++ b/plugins/reorder.py @@ -92,7 +92,11 @@ def parse_config(tab_config): if pos in result or pos <= 0: return None - typ, name = tab_config.get(option, default=':').split(':', maxsplit=1) + spec = tab_config.get(option, default=':').split(':', maxsplit=1) + # Gap tabs are recreated automatically if there's a gap in indices. + if spec == 'empty': + return None + typ, name = spec if typ not in TEXT_TO_TAB: return None result[pos] = (TEXT_TO_TAB[typ], name) -- cgit v1.2.3 From 75d7f5da9368f6ce6947aa5a1728f94eb149d4d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 15 Jun 2020 16:06:48 +0200 Subject: plugins/reorder: Don't serialize gaptabs as they're recreated automatically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- plugins/reorder.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/reorder.py b/plugins/reorder.py index 4a5f515e..38975a02 100644 --- a/plugins/reorder.py +++ b/plugins/reorder.py @@ -117,9 +117,8 @@ def parse_runtime_tablist(tablist): for tab in tablist[1:]: i += 1 result = check_tab(tab) - if result == 'empty': - props.append((i, 'empty')) - elif result: + # Don't serialize gap tabs as they're recreated automatically + if result != 'empty': props.append((i, '%s:%s' % (result, tab.jid.full))) return props -- cgit v1.2.3