diff --git a/src/window.cc b/src/window.cc index e242d508..09c5c1d8 100644 --- a/src/window.cc +++ b/src/window.cc @@ -35,48 +35,6 @@ Window::~Window() m_option_manager.unregister_watcher(*this); } -BufferIterator Window::iterator_at(const DisplayCoord& window_pos) const -{ - if (m_display_buffer.begin() == m_display_buffer.end()) - return buffer().begin(); - - if (DisplayCoord(0,0) <= window_pos) - { - for (auto atom_it = m_display_buffer.begin(); - atom_it != m_display_buffer.end(); ++atom_it) - { - if (window_pos < atom_it->coord()) - { - return (--atom_it)->iterator_at(window_pos); - } - } - } - - return buffer().iterator_at(m_position + BufferCoord(window_pos)); -} - -DisplayCoord Window::line_and_column_at(const BufferIterator& iterator) const -{ - if (m_display_buffer.begin() == m_display_buffer.end()) - return DisplayCoord(0, 0); - - if (iterator >= m_display_buffer.front().begin() and - iterator < m_display_buffer.back().end()) - { - for (auto& atom : m_display_buffer) - { - if (atom.end() > iterator) - { - assert(atom.begin() <= iterator); - return atom.line_and_column_at(iterator); - } - } - } - BufferCoord coord = buffer().line_and_column_at(iterator); - return DisplayCoord(coord.line - m_position.line, - coord.column - m_position.column); -} - void Window::update_display_buffer() { scroll_to_keep_cursor_visible_ifn(); diff --git a/src/window.hh b/src/window.hh index 7950cb0e..f4508187 100644 --- a/src/window.hh +++ b/src/window.hh @@ -28,9 +28,6 @@ public: const BufferCoord& position() const { return m_position; } - BufferIterator iterator_at(const DisplayCoord& window_pos) const; - DisplayCoord line_and_column_at(const BufferIterator& iterator) const; - void set_dimensions(const DisplayCoord& dimensions); const DisplayBuffer& display_buffer() const { return m_display_buffer; }