Keep buffer index-id map a script scope variable.