diff options
Diffstat (limited to 'poezio')
-rw-r--r-- | poezio/core/commands.py | 14 | ||||
-rw-r--r-- | poezio/core/core.py | 6 | ||||
-rw-r--r-- | poezio/core/tabs.py | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/poezio/core/commands.py b/poezio/core/commands.py index 6bf1d338..46dab5cc 100644 --- a/poezio/core/commands.py +++ b/poezio/core/commands.py @@ -219,6 +219,20 @@ class CommandCore: return self.core.tabs.set_current_tab(match) + @command_args_parser.quoted(1) + def wup(self, args): + """ + /wup <prefix of name> + """ + if args is None: + return self.help('wup') + + prefix = args[0] + _, match = self.core.tabs.find_by_unique_prefix(prefix) + if match is None: + return + self.core.tabs.set_current_tab(match) + @command_args_parser.quoted(2) def move_tab(self, args): """ diff --git a/poezio/core/core.py b/poezio/core/core.py index 06d56062..eac9d539 100644 --- a/poezio/core/core.py +++ b/poezio/core/core.py @@ -1709,6 +1709,12 @@ class Core: usage='<number or name>', shortdesc='Go to the specified room', completion=self.completion.win) + self.register_command( + 'wup', + self.command.wup, + usage='<prefix>', + shortdesc='Go to the tab whose name uniquely starts with prefix', + completion=self.completion.win) self.commands['w'] = self.commands['win'] self.register_command( 'move_tab', diff --git a/poezio/core/tabs.py b/poezio/core/tabs.py index c5ecb206..d5909d39 100644 --- a/poezio/core/tabs.py +++ b/poezio/core/tabs.py @@ -29,6 +29,7 @@ from collections import defaultdict from slixmpp import JID from poezio import tabs from poezio.events import EventHandler +from poezio.config import config class Tabs: |