diff --git a/gertty/app.py b/gertty/app.py index 3da1c2b..60e5925 100644 --- a/gertty/app.py +++ b/gertty/app.py @@ -515,11 +515,7 @@ class App(object): elif keymap.QUIT in commands: self.quit() elif keymap.CHANGE_SEARCH in commands: - if hasattr(self.loop.widget, 'getQueryString'): - default = self.loop.widget.getQueryString() - else: - default = '' - self.searchDialog(default) + self.searchDialog('') elif keymap.LIST_HELD in commands: self.doSearch("is:held") elif key in self.config.dashboards: diff --git a/gertty/keymap.py b/gertty/keymap.py index c5f0401..1d770a5 100644 --- a/gertty/keymap.py +++ b/gertty/keymap.py @@ -35,6 +35,7 @@ TOP_SCREEN = 'top screen' HELP = 'help' QUIT = 'quit' CHANGE_SEARCH = 'change search' +REFINE_CHANGE_SEARCH = 'refine change search' LIST_HELD = 'list held changes' # Change screen: TOGGLE_REVIEWED = 'toggle reviewed' @@ -87,6 +88,7 @@ DEFAULT_KEYMAP = { HELP: ['f1', '?'], QUIT: 'ctrl q', CHANGE_SEARCH: 'ctrl o', + REFINE_CHANGE_SEARCH: 'meta o', LIST_HELD: 'f12', TOGGLE_REVIEWED: 'v', diff --git a/gertty/view/change_list.py b/gertty/view/change_list.py index f1012da..38a1ef8 100644 --- a/gertty/view/change_list.py +++ b/gertty/view/change_list.py @@ -178,6 +178,8 @@ class ChangeListView(urwid.WidgetWrap): "Toggle the starred flag for the currently selected change"), (key(keymap.TOGGLE_MARK), "Toggle the process mark for the currently selected change"), + (key(keymap.REFINE_CHANGE_SEARCH), + "Refine the current search query"), (key(keymap.EDIT_TOPIC), "Set the topic of the marked changes"), (key(keymap.REFRESH), @@ -559,6 +561,10 @@ class ChangeListView(urwid.WidgetWrap): row = self.listbox.body[pos] self.app.localCherryPickCommit(row.project_name, row.commit_sha) return None + if keymap.REFINE_CHANGE_SEARCH in commands: + default = self.getQueryString() + self.app.searchDialog(default) + return None return key def onSelect(self, button, change_key):