Fixes #83366: buffer is updated when the selection changes.