| 684 | } |
| 685 | |
| 686 | ViewState RcxEditor::saveViewState() const { |
| 687 | ViewState vs; |
| 688 | vs.scrollLine = (int)m_sci->SendScintilla(QsciScintillaBase::SCI_GETFIRSTVISIBLELINE); |
| 689 | int line, col; |
| 690 | m_sci->getCursorPosition(&line, &col); |
| 691 | vs.cursorLine = line; |
| 692 | vs.cursorCol = col; |
| 693 | vs.xOffset = (int)m_sci->SendScintilla(QsciScintillaBase::SCI_GETXOFFSET); |
| 694 | return vs; |
| 695 | } |
| 696 | |
| 697 | void RcxEditor::restoreViewState(const ViewState& vs) { |
| 698 | int maxLine = std::max(0, m_sci->lines() - 1); |