summaryrefslogtreecommitdiff
path: root/src/display_buffer.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2016-07-28 09:41:47 +0100
committerMaxime Coste <frrrwww@gmail.com>2016-07-28 09:41:47 +0100
commita7005ec74be9eef4595031bfe9191cc8bd5a08e3 (patch)
tree497e00c33a89230efce4cc14b02868be7fc2eab6 /src/display_buffer.cc
parent74c3f101cd60e213962026f0bb0235102f7bc833 (diff)
Add a char_length(Buffer&, const ByteCoord&, const ByteCoord&) util
Diffstat (limited to 'src/display_buffer.cc')
-rw-r--r--src/display_buffer.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/display_buffer.cc b/src/display_buffer.cc
index c112679d..c26ca8da 100644
--- a/src/display_buffer.cc
+++ b/src/display_buffer.cc
@@ -2,6 +2,7 @@
#include "assert.hh"
#include "buffer.hh"
+#include "buffer_utils.hh"
#include "utf8.hh"
#include "face_registry.hh"
@@ -62,8 +63,7 @@ CharCount DisplayAtom::length() const
switch (m_type)
{
case BufferRange:
- return utf8::distance(m_buffer->iterator_at(m_range.begin),
- m_buffer->iterator_at(m_range.end));
+ return char_length(*m_buffer, m_range.begin, m_range.end);
case Text:
case ReplacedBufferRange:
return m_text.char_length();