fix #23319. When inserting a spanner, extend it to the end of measure