Fix #1952498 [[Enhancement - E-book viewer] Don't search for selection if it is a blanc space](https://bugs.launchpad.net/calibre/+bug/1952498)

This commit is contained in:
Kovid Goyal 2021-11-29 13:21:00 +05:30
parent cb9d4c5416
commit 1dbbf5b73d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1010,6 +1010,9 @@ class SelectionBar:
self.view.overlay.show_word_actions(self.view.currently_showing.selection.text)
def book_search(self):
cs = self.view.currently_showing?.selection?.text
if not cs or len(str.strip(cs)) < 2:
return error_dialog(_('Too little text'), _('Cannot search as too little text is selected. You must select at least two characters.'))
self.view.show_search(True)
self.clear_selection()