From 057f07448f9dea7ea42d45ad9cf40e3a3bf78f7a Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Fri, 21 Sep 2012 16:12:07 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20=E2=80=9Cmove=20selection=E2=80=9D=20for?= =?UTF-8?q?=20east=20asian=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since it moves one column left/right and east asian scripts have their glyphs count as two columns, it would effectively move half a column, which in practice would be done by inserting a space. Fixes issue #469. --- Frameworks/editor/src/editor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Frameworks/editor/src/editor.cc b/Frameworks/editor/src/editor.cc index 497aae22..18f7e5d0 100644 --- a/Frameworks/editor/src/editor.cc +++ b/Frameworks/editor/src/editor.cc @@ -1237,11 +1237,11 @@ namespace ng { text::pos_t pos = _buffer.convert(pair->first); int line = pos.line; - int col = visual_distance(_buffer, _buffer.begin(line), pair->first); + int col = visual_distance(_buffer, _buffer.begin(line), pair->first, false); line = oak::cap(0, line + deltaY, int(_buffer.lines()-1)); col = std::max(col + deltaX, 0); - replacements.insert(std::make_pair(visual_advance(_buffer, _buffer.begin(line), col), pair->second)); + replacements.insert(std::make_pair(visual_advance(_buffer, _buffer.begin(line), col, false), pair->second)); } _selections = this->replace(replacements, true); }