From 9002059c0dbd436b468ff5cd2681da831c902f3e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 17 Jan 2013 18:50:04 +0100 Subject: [PATCH] Window: fix display position, count utf8 characters for column --- src/window.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();