MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / handle_redo

Method handle_redo

crates/opencode-tui/src/app/app.rs:2024–2044  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

2022 }
2023
2024 fn handle_redo(&mut self) {
2025 let Some(_session_id) = self.current_session_id() else {
2026 self.alert_dialog.set_message("No active session for redo.");
2027 self.alert_dialog.open();
2028 return;
2029 };
2030 // Redo re-submits the current prompt content (which was restored by undo)
2031 let input = self.prompt.get_input().trim().to_string();
2032 if input.is_empty() {
2033 self.alert_dialog
2034 .set_message("Nothing to redo. Prompt is empty.");
2035 self.alert_dialog.open();
2036 return;
2037 }
2038 // Re-submit the prompt to effectively redo
2039 if let Err(err) = self.submit_prompt() {
2040 self.alert_dialog
2041 .set_message(&format!("Failed to redo:\n{}", err));
2042 self.alert_dialog.open();
2043 }
2044 }
2045
2046 fn handle_copy_session(&mut self) {
2047 let Some(session_id) = self.current_session_id() else {

Callers 1

Calls 6

current_session_idMethod · 0.80
set_messageMethod · 0.80
get_inputMethod · 0.80
is_emptyMethod · 0.80
submit_promptMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected