fix off-by-one in incremental editing