MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / handle_update_provider_key

Method handle_update_provider_key

crates/openshell-tui/src/app.rs:2438–2460  ·  view source on GitHub ↗
(&mut self, key: KeyEvent)

Source from the content-addressed store, hash-verified

2436 }
2437
2438 fn handle_update_provider_key(&mut self, key: KeyEvent) {
2439 let Some(form) = self.update_provider_form.as_mut() else {
2440 return;
2441 };
2442
2443 match key.code {
2444 KeyCode::Esc => {
2445 self.update_provider_form = None;
2446 }
2447 KeyCode::Enter => {
2448 if form.new_value.is_empty() {
2449 form.status = Some("Value is required.".to_string());
2450 return;
2451 }
2452 self.pending_provider_update = true;
2453 }
2454 KeyCode::Char(c) => form.new_value.push(c),
2455 KeyCode::Backspace => {
2456 form.new_value.pop();
2457 }
2458 _ => {}
2459 }
2460 }
2461
2462 // ------------------------------------------------------------------
2463 // Shared helpers

Callers 1

handle_keyMethod · 0.80

Calls 2

pushMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected