This is a bug because the downside of this behaviour is outweighed by some tiny upside.
But I've never seen a person editing a bash script without an editor that swaps in a new version of the file until today, so never knowingly encountered this bug before.
It should be fixed.