diff --git a/src/pyj/read_book/selection_bar.pyj b/src/pyj/read_book/selection_bar.pyj index 2abb486157..77c8497a1c 100644 --- a/src/pyj/read_book/selection_bar.pyj +++ b/src/pyj/read_book/selection_bar.pyj @@ -610,6 +610,8 @@ class SelectionBar: 'toggle_highlights': True, 'edit_book': True, 'select_all': True, + 'extend_selection_to_end_of_line': True, + 'extend_selection_to_start_of_line': True, } if sc_name is 'show_chrome': self.clear_selection() diff --git a/src/pyj/read_book/shortcuts.pyj b/src/pyj/read_book/shortcuts.pyj index f92b33b20d..eac67146fb 100644 --- a/src/pyj/read_book/shortcuts.pyj +++ b/src/pyj/read_book/shortcuts.pyj @@ -350,6 +350,18 @@ def common_shortcuts(): # {{{ _('Alter the current selection forward by a line'), ), + 'extend_selection_to_start_of_line': desc( + v"['Shift+Home']", + 'ui', + _('Extend current selection to the start of the line'), + ), + + 'extend_selection_to_end_of_line': desc( + v"['Shift+End']", + 'ui', + _('Extend current selection to the end of the line'), + ), + 'select_all': desc( v'["Ctrl+a"]', 'ui', diff --git a/src/pyj/read_book/view.pyj b/src/pyj/read_book/view.pyj index be39e35791..e225ba5dcb 100644 --- a/src/pyj/read_book/view.pyj +++ b/src/pyj/read_book/view.pyj @@ -575,6 +575,10 @@ class View: self.iframe_wrapper.send_message('modify_selection', direction='backward', granularity=data.name.rpartition('_')[-1]) elif data.name.startsWith('extend_selection_by_'): self.iframe_wrapper.send_message('modify_selection', direction='forward', granularity=data.name.rpartition('_')[-1]) + elif data.name is 'extend_selection_to_start_of_line': + self.iframe_wrapper.send_message('modify_selection', direction='backward', granularity='lineboundary') + elif data.name is 'extend_selection_to_end_of_line': + self.iframe_wrapper.send_message('modify_selection', direction='forward', granularity='lineboundary') elif data.name is 'scrollspeed_increase': self.update_scroll_speed(SCROLL_SPEED_STEP) elif data.name is 'scrollspeed_decrease':