don't crash when inserting an unterminated line before a fold