fix a bug on cursor movement
add line deletion