bugfix: use correct commit index when files are being edited