Mercurial > octave
changeset 27091:dcc3a8065ccd
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
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Sat, 18 May 2019 12:17:57 +0200 |
parents | e83d3161b256 |
children | d1fe5bd5e005 |
files | libgui/src/documentation.cc |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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)