From 0316100785d8687a7fdfbb8d7bd47c92d923203c Mon Sep 17 00:00:00 2001 From: Emanuel Rylke Date: Fri, 5 Dec 2014 21:02:15 +0100 Subject: [PATCH] Make TextInput correctly handle multibyte chars. --- components/script/textinput.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/script/textinput.rs b/components/script/textinput.rs index 9e14f9c8e6b..6903dfc5c4a 100644 --- a/components/script/textinput.rs +++ b/components/script/textinput.rs @@ -149,7 +149,7 @@ impl TextInput { /// Return the length of the current line under the editing point. fn current_line_length(&self) -> uint { - self.lines[self.edit_point.line].len() + self.lines[self.edit_point.line].char_len() } /// Adjust the editing point position by a given of lines. The resulting column is