MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / handle

Method handle

crates/chat-cli/src/cli/chat/prompt.rs:525–550  ·  view source on GitHub ↗
(
        &self,
        _evt: &rustyline::Event,
        _n: rustyline::RepeatCount,
        _positive: bool,
        _ctx: &rustyline::EventContext<'_>,
    )

Source from the content-addressed store, hash-verified

523
524impl rustyline::ConditionalEventHandler for PasteImageHandler {
525 fn handle(
526 &self,
527 _evt: &rustyline::Event,
528 _n: rustyline::RepeatCount,
529 _positive: bool,
530 _ctx: &rustyline::EventContext<'_>,
531 ) -> Option<Cmd> {
532 match paste_image_from_clipboard() {
533 Ok(path) => {
534 // Store the full path in shared state and get the count
535 let count = self.paste_state.add(path);
536
537 // Insert [Image #N] marker so user sees what they're pasting
538 // User presses Enter to submit
539 Some(Cmd::Insert(1, format!("[Image #{}]", count)))
540 },
541 Err(ClipboardError::NoImage) => {
542 // Silent fail - no image to paste
543 Some(Cmd::Noop)
544 },
545 Err(_) => {
546 // Could log error, but don't interrupt user
547 Some(Cmd::Noop)
548 },
549 }
550 }
551}
552
553pub fn rl(

Callers

nothing calls this directly

Calls 3

InsertClass · 0.85
addMethod · 0.45

Tested by

no test coverage detected