| 1262 | } |
| 1263 | |
| 1264 | TextRange TextDocument::addSelections( TextRanges&& selections ) { |
| 1265 | mSelection.reserve( mSelection.size() + selections.size() ); |
| 1266 | for ( auto& selection : selections ) |
| 1267 | mSelection.push_back( sanitizeRange( selection ) ); |
| 1268 | mSelection.sort(); |
| 1269 | mergeSelection(); |
| 1270 | notifyCursorChanged( selections.back().start() ); |
| 1271 | notifySelectionChanged( selections.back() ); |
| 1272 | mLastSelection = mSelection.findIndex( selections.back() ); |
| 1273 | return selections.back(); |
| 1274 | } |
| 1275 | |
| 1276 | TextRange TextDocument::addSelection( TextRange selection ) { |
| 1277 | if ( mSelection.exists( selection ) ) |