summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-06-04 13:42:45 +0200
committerMaxime Coste <frrrwww@gmail.com>2013-06-04 14:21:07 +0200
commit5c2e3b25facf878cafff7499d901de27a27645ff (patch)
tree2e9bf1ca9f9311d88738d352adc9e6d8e15b900f /src
parent76f55f5256f15109c7b245ca398e4dde3f5223c6 (diff)
Window: use AtomContent::length in scroll_to_keep_cursor_visible_ifn
Diffstat (limited to 'src')
-rw-r--r--src/window.cc5
1 files changed, 1 insertions, 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;