Disallow tab=None with objreg.get(scope='tab').

This would've made it a lot easier to detect #563.
This commit is contained in:
Florian Bruhin 2015-03-19 22:28:24 +01:00
parent 7a4a4a4a4e
commit adb11360db
2 changed files with 2 additions and 2 deletions

View File

@ -529,7 +529,7 @@ class CommandDispatcher:
url = self._current_url() url = self._current_url()
if frame is None: if frame is None:
raise cmdexc.CommandError("No frame focused!") raise cmdexc.CommandError("No frame focused!")
hintmanager = objreg.get('hintmanager', scope='tab') hintmanager = objreg.get('hintmanager', scope='tab', tab='current')
if where == 'prev': if where == 'prev':
hintmanager.follow_prevnext(frame, url, prev=True, tab=tab, hintmanager.follow_prevnext(frame, url, prev=True, tab=tab,
background=bg, window=window) background=bg, window=window)

View File

@ -144,7 +144,7 @@ window_registry = ObjectRegistry()
def _get_tab_registry(win_id, tab_id): def _get_tab_registry(win_id, tab_id):
"""Get the registry of a tab.""" """Get the registry of a tab."""
if tab_id is None: if tab_id is None:
tab_id = 'current' raise ValueError("Got tab_id None (win_id {})".format(win_id))
if tab_id == 'current' and win_id is None: if tab_id == 'current' and win_id is None:
app = get('app') app = get('app')
window = app.activeWindow() window = app.activeWindow()