| 720 | } |
| 721 | |
| 722 | void TextfileWindow::ScrollToLine(size_t line) |
| 723 | { |
| 724 | Scrollbar *sb = this->GetScrollbar(WID_TF_VSCROLLBAR); |
| 725 | int newpos = 0; |
| 726 | for (auto it = std::begin(this->lines); it != std::end(this->lines) && line > 0; --line, ++it) { |
| 727 | newpos += it->num_lines; |
| 728 | } |
| 729 | sb->SetPosition(std::min(newpos, sb->GetCount() - sb->GetCapacity())); |
| 730 | this->UpdateVisibleIterators(); |
| 731 | this->ReflowContent(); |
| 732 | this->SetDirty(); |
| 733 | } |
| 734 | |
| 735 | bool TextfileWindow::IsTextWrapped() const |
| 736 | { |
no test coverage detected