Upgrade text-buffer to remove deprecations