From ae222c64f38685f79587eb1e4f898951c69a2e02 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 25 Oct 2020 11:47:50 +0530 Subject: [PATCH] Viewer: Fix keyboard shortcuts to shrink/grow selection not working. Fixes #1900942 [E-book viewer: the "Alter the current selection" feature doesn't seem to work](https://bugs.launchpad.net/calibre/+bug/1900942) --- src/pyj/read_book/selection_bar.pyj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pyj/read_book/selection_bar.pyj b/src/pyj/read_book/selection_bar.pyj index 2f19f76d14..f363235e2c 100644 --- a/src/pyj/read_book/selection_bar.pyj +++ b/src/pyj/read_book/selection_bar.pyj @@ -564,6 +564,7 @@ class SelectionBar: sc_name = shortcut_for_key_event(ev, self.view.keyboard_shortcut_map) if not sc_name: return + forwarded = {'toggle_highlights': True, 'extend_selection_by_word': True, 'shrink_selection_by_word': True} if sc_name is 'show_chrome': self.clear_selection() elif sc_name is 'copy_to_clipboard': @@ -574,7 +575,7 @@ class SelectionBar: self.book_search() elif sc_name is 'new_bookmark': self.new_bookmark() - elif sc_name is 'toggle_highlights': + elif forwarded[sc_name]: self.view.on_handle_shortcut({'name': sc_name}) def report_failed_edit_highlight(self, annot_id):