Repository: bevyengine/bevy
File: tools/export-content/src/app.rs (Rust)

Code before:
                        }
                        KeyCode::Char(c) => text.push(c),
                        _ => {}
                    }

                    continue;
                }

                match key.code {
                    KeyCode::Esc => self.exit = true,
                    KeyCode::Tab => match self.mode {
                        Mode::ReleaseNotes => self.mode = Mode::MigrationGuides,
                        Mode::MigrationGuides => self.mode = Mode::ReleaseNotes,
                    },
                    KeyCode::Down => {
                        if key.modifiers.contains(KeyModifiers::SHIFT) {
                            if let Some(index) = mode_state.selected() {
                                if index < mode_entries.len() - 1 {
                                    mode_entries.swap(index, index + 1);
                                }
                            }
                        }
                        mode_state.select_next();
                    }
                    KeyCode::Up => {
                        if key.modifiers.contains(KeyModifiers::SHIFT) {
                            if let Some(index) = mode_state.selected() {
                                if index > 0 {
                                    mode_entries.swap(index, index - 1);
                                }
                            }
                        }
                        mode_state.select_previous();
                    }
                    KeyCode::Char('+') => {
                        self.text_entry = Some(String::new());
                    }
                    KeyCode::Char('d') => {
                        if let Some(index) = mode_state.selected() {
                            if let Entry::Section { .. } = mode_entries[index] {
                                mode_entries.remove(index);
                            }
                        }
                    }
                    _ => {}
                }
            }
        }

        self.write_output()
    }

Review comment (suggestion):
ditto:
```suggestion
                        if key.modifiers.contains(KeyModifiers::SHIFT)
                            && let Some(index) = mode_state.selected()
                            && index > 0
                        {

```

Code after:
                        }
                        KeyCode::Char(c) => text.push(c),
                        _ => {}
                    }

                    continue;
                }

                match key.code {
                    KeyCode::Esc => self.exit = true,
                    KeyCode::Tab => match self.mode {
                        Mode::ReleaseNotes => self.mode = Mode::MigrationGuides,
                        Mode::MigrationGuides => self.mode = Mode::ReleaseNotes,
                    },
                    KeyCode::Down => {
                        if key.modifiers.contains(KeyModifiers::SHIFT)
                            && let Some(index) = mode_state.selected()
                            && index < mode_entries.len() - 1
                        {
                            mode_entries.swap(index, index + 1);
                        }
                        mode_state.select_next();
                    }
                    KeyCode::Up => {
                        if key.modifiers.contains(KeyModifiers::SHIFT)
                            && let Some(index) = mode_state.selected()
                            && index > 0
                        {
                            mode_entries.swap(index, index - 1);
                        }
                        mode_state.select_previous();
                    }
                    KeyCode::Char('+') => {
                        self.text_entry = Some(String::new());
                    }
                    KeyCode::Char('d') => {
                        if let Some(index) = mode_state.selected()
                            && let Entry::Section { .. } = mode_entries[index]
                        {
                            mode_entries.remove(index);
                        }
                    }
                    _ => {}
                }
            }
        }

        self.write_output()
    }

    pub fn render(&mut self, frame: &mut Frame) {