From 5c2e3b25facf878cafff7499d901de27a27645ff Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 4 Jun 2013 13:42:45 +0200 Subject: [PATCH] Window: use AtomContent::length in scroll_to_keep_cursor_visible_ifn --- src/window.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/window.cc b/src/window.cc index dba0a302..24cffed6 100644 --- a/src/window.cc +++ b/src/window.cc @@ -143,10 +143,7 @@ void Window::scroll_to_keep_cursor_visible_ifn() if (atom.content.has_buffer_range() and atom.content.begin() <= last and atom.content.end() > last) { - if (atom.content.type() == AtomContent::BufferRange) - column += buffer().char_distance(atom.content.begin(), last); - else - column += atom.content.content().char_length(); + column += atom.content.length(); CharCount first_col = first.line == last.line ? buffer().char_distance(last.line, first) : 0_char;