Delete characters with backspace

This commit is contained in:
Joscha 2017-04-06 13:08:18 +00:00
parent 38ab48d6f8
commit 704ff9b3d1
3 changed files with 20 additions and 14 deletions

View file

@ -43,7 +43,9 @@ class ChunkDiff():
self._chars[x+y*CHUNK_WIDTH] = character
def delete(self, x, y):
del self._chars[x+y*CHUNK_WIDTH]
pos = x + y*CHUNK_WIDTH
if pos in self._chars:
del self._chars[x+y*CHUNK_WIDTH]
def apply(self, diff):
for i, c in diff._chars.items():