Window: fix display position, count utf8 characters for column

This commit is contained in:
Maxime Coste 2013-01-17 18:50:04 +01:00
parent f1b6108367
commit 9002059c0d

View File

@ -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();