bool appl::TextViewer::moveCursor(const appl::Buffer::Iterator& _pos) { if (m_buffer == nullptr) { return false; } markToRedraw(); if (m_pluginManager->onCursorMove(*this, _pos) == true) { updateScrolling(); return true; } m_buffer->moveCursor((int64_t)_pos); updateScrolling(); return true; }
bool appl::TextViewer::replace(const std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) { if (m_buffer == nullptr) { return false; } markToRedraw(); if (m_pluginManager->onReplace(*this, _pos, _data, _posEnd) == true) { // no call of the move cursor, because pluging might call theses function to copy and cut data... updateScrolling(); return true; } bool ret = m_buffer->replace(_data, _pos, _posEnd); m_pluginManager->onCursorMove(*this, m_buffer->cursor()); updateScrolling(); return ret; }
void Console::timepass() { Frame::timepass(); updateScrolling(); }