line wrapping, cursor positioning