diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-05-23 19:21:34 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-05-30 13:59:38 +0200 |
| commit | 52b77c19154f1f656e47c2f7e37d05fa050ff032 (patch) | |
| tree | 9891dfcd47d13bb232be48028be6619e5e615d6d /src/window.cc | |
| parent | 4f1ba860f80838990fd05bc3f723339d221a2684 (diff) | |
window, editor: take coords rather than iterators parameters
Diffstat (limited to 'src/window.cc')
| -rw-r--r-- | src/window.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/window.cc b/src/window.cc index 73158972..6dea573e 100644 --- a/src/window.cc +++ b/src/window.cc @@ -176,20 +176,21 @@ void Window::scroll_to_keep_cursor_visible_ifn() } } -DisplayCoord Window::display_position(const BufferIterator& iterator) +DisplayCoord Window::display_position(const BufferCoord& coord) { DisplayCoord res{0,0}; for (auto& line : m_display_buffer.lines()) { - if (line.buffer_line() == iterator.line()) + if (line.buffer_line() == coord.line) { for (auto& atom : line) { auto& content = atom.content; if (content.has_buffer_range() and - iterator.coord() >= content.begin() and iterator.coord() < content.end()) + coord >= content.begin() and coord < content.end()) { - res.column += utf8::distance(buffer().iterator_at(content.begin()), iterator); + res.column += utf8::distance(buffer().iterator_at(content.begin()), + buffer().iterator_at(coord)); return res; } res.column += content.length(); |
