diff --git a/src/window.cc b/src/window.cc index 8d45d6fa..8384ccc1 100644 --- a/src/window.cc +++ b/src/window.cc @@ -149,7 +149,7 @@ DisplayCoord Window::display_position(const BufferIterator& iterator) if (content.has_buffer_range() and iterator >= content.begin() and iterator < content.end()) { - res.column += iterator - content.begin(); + res.column += utf8::distance(content.begin(), iterator); return res; } res.column += content.length();