From 71fcc123bca371f83a3a05e1c121d89e1fc07a2a Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 12 Jul 2012 14:28:58 +0200 Subject: [PATCH] Window: remove iterator_at and line_and_column_at methods --- src/window.cc | 42 ------------------------------------------ src/window.hh | 3 --- 2 files changed, 45 deletions(-) diff --git a/src/window.cc b/src/window.cc index e242d5081..09c5c1d85 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 7950cb0ee..f4508187c 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; }