Fix bug on K_DELETE when the line is empty
This commit is contained in:
parent
53ddd7be9f
commit
43450a8c37
13
fide.py
13
fide.py
@ -106,14 +106,15 @@ if __name__ == '__main__':
|
||||
if cursor.col >= rows[cursor.row].length:
|
||||
if cursor.row < len(rows) - 1:
|
||||
below_row = rows.pop(cursor.row+1)
|
||||
row = rows[cursor.row]
|
||||
row.text.insert(below_row.text.get_text(), row.length)
|
||||
if below_row.length > 0:
|
||||
row.text.insert(below_row.text.get_text(), row.length)
|
||||
row.length += below_row.length
|
||||
cursor.want_col = cursor.col
|
||||
row.length += below_row.length
|
||||
else:
|
||||
row.text.delete(cursor.col, 1)
|
||||
row.length -= 1
|
||||
cursor.want_col = cursor.col
|
||||
if row.length >= 1:
|
||||
row.text.delete(cursor.col, 1)
|
||||
row.length -= 1
|
||||
cursor.want_col = cursor.col
|
||||
elif event.key == pg.K_LEFT:
|
||||
if cursor.col == 0:
|
||||
if cursor.row > 0:
|
||||
|
Loading…
x
Reference in New Issue
Block a user