TextInput: proper buffer specific state saving & restoring