editor: iterate backwards when deleting lines

Otherwise, line numbers will be off.