mirror of https://github.com/kivy/kivy.git
uix:TextInput revert performance improvements for backspace; were leading
to erroronous cursor position in corner cases.
This commit is contained in:
parent
b1701f7619
commit
ce2b3ae8ac
|
@ -555,24 +555,7 @@ class TextInput(Widget):
|
||||||
self._refresh_text_from_property('del', start, finish, lines,
|
self._refresh_text_from_property('del', start, finish, lines,
|
||||||
lineflags, len_lines)
|
lineflags, len_lines)
|
||||||
|
|
||||||
# Instead of calling get_cursor_from_index every time avoid till it's
|
self.cursor = self.get_cursor_from_index(cursor_index - 1)
|
||||||
# really needed leads to improvements while editing large amounts of
|
|
||||||
# text.
|
|
||||||
if self.selection_from != self.selection_to:
|
|
||||||
col, row = self.get_cursor_from_index(cursor_index - 1)
|
|
||||||
else:
|
|
||||||
col, row = cc, cr
|
|
||||||
if col == 0:
|
|
||||||
if row:
|
|
||||||
row -= 1
|
|
||||||
col = prev_line_len
|
|
||||||
else:
|
|
||||||
if (row > 0) and text_last_line != self._lines[row - 1]:
|
|
||||||
col, row = self.get_cursor_from_index(cursor_index - 1)
|
|
||||||
else:
|
|
||||||
col, row = col - 1, row
|
|
||||||
|
|
||||||
self.cursor = col, row
|
|
||||||
# handle undo and redo
|
# handle undo and redo
|
||||||
self._set_undo_redo_bkspc(
|
self._set_undo_redo_bkspc(
|
||||||
cursor_index,
|
cursor_index,
|
||||||
|
|
Loading…
Reference in New Issue