Fix bug of TextInput.adjust_vertical(1) always moving to the end of text.

This commit is contained in:
Emanuel Rylke 2014-12-06 14:26:28 +01:00
parent 2d0e96e133
commit 2ec16a0e88

View file

@ -163,7 +163,7 @@ impl TextInput {
self.edit_point.index = 0; self.edit_point.index = 0;
self.edit_point.line = 0; self.edit_point.line = 0;
return; return;
} else if adjust > 0 && self.edit_point.line >= min(0, self.lines.len() - adjust as uint) { } else if adjust > 0 && self.edit_point.line >= self.lines.len() - adjust as uint {
self.edit_point.index = self.current_line_length(); self.edit_point.index = self.current_line_length();
self.edit_point.line = self.lines.len() - 1; self.edit_point.line = self.lines.len() - 1;
return; return;