fix overflow in multiline edits