# HG changeset patch # User Torsten Lilge # Date 1558174677 -7200 # Node ID dcc3a8065ccd72a26d7c1f37167765d55a3a25ec # Parent e83d3161b2562b83ce23162fbf63b01c54a0cca8 wrap during search-while-typing in doc browser (bug #56216) * documentation.cc (find_forward_from_anchor): repeat search from the top of the text if no more occurence of the current search string is found diff -r e83d3161b256 -r dcc3a8065ccd libgui/src/documentation.cc --- a/libgui/src/documentation.cc Thu May 16 22:54:41 2019 +0200 +++ b/libgui/src/documentation.cc Sat May 18 12:17:57 2019 +0200 @@ -710,10 +710,18 @@ if (! m_help_engine) return; + // Search from the current position QTextCursor textcur = m_doc_browser->textCursor (); textcur.setPosition (m_search_anchor_position); m_doc_browser->setTextCursor (textcur); - m_doc_browser->find (text); + + if (! m_doc_browser->find (text)) + { + // Nothing was found, restart search from the beginning + textcur.setPosition (0); + m_doc_browser->setTextCursor (textcur); + m_doc_browser->find (text); + } } void documentation::record_anchor_position (void)