| 355 | } |
| 356 | |
| 357 | void DocSearchController::selectAll( SearchState& search ) { |
| 358 | if ( !search.editor || !mSplitter->editorExists( search.editor ) ) |
| 359 | return; |
| 360 | if ( search.text.empty() ) |
| 361 | search.text = mLastSearch; |
| 362 | if ( search.text.empty() ) |
| 363 | return; |
| 364 | search.editor->getDocument().setActiveClient( search.editor ); |
| 365 | mLastSearch = search.text; |
| 366 | TextDocument& doc = search.editor->getDocument(); |
| 367 | auto ranges = doc.findAll( search.text, search.caseSensitive, search.wholeWord, search.type, |
| 368 | search.range ); |
| 369 | for ( const auto& range : ranges ) |
| 370 | doc.addSelection( range.result.reversed() ); |
| 371 | } |
| 372 | |
| 373 | int DocSearchController::replaceAll( SearchState& search, const String& replace ) { |
| 374 | if ( !search.editor || !mSplitter->editorExists( search.editor ) ) |