// TODO separate cursor movement from buffer operations in protocol!