| 267 | } |
| 268 | |
| 269 | TextRange DocumentView::getVisibleIndexRange( VisibleIndex visibleIndex ) const { |
| 270 | if ( isOneToOne() ) |
| 271 | return mDoc->getLineRange( static_cast<Int64>( visibleIndex ) ); |
| 272 | Int64 idx = static_cast<Int64>( visibleIndex ); |
| 273 | auto start = getVisibleIndexPosition( visibleIndex ); |
| 274 | auto end = start; |
| 275 | eeASSERT( visibleIndex >= static_cast<VisibleIndex>( 0 ) ); |
| 276 | if ( idx >= 0 && idx + 1 < static_cast<Int64>( mVisibleLines.size() ) && |
| 277 | mVisibleLines[idx + 1].line() == start.line() ) { |
| 278 | end.setColumn( mVisibleLines[idx + 1].column() ); |
| 279 | } else { |
| 280 | end.setColumn( mDoc->getLineLength( start.line() ) ); |
| 281 | } |
| 282 | return { start, end }; |
| 283 | } |
| 284 | |
| 285 | std::shared_ptr<TextDocument> DocumentView::getDocument() const { |
| 286 | return mDoc; |
no test coverage detected