(
&self,
_evt: &rustyline::Event,
_n: rustyline::RepeatCount,
_positive: bool,
_ctx: &rustyline::EventContext<'_>,
)
| 523 | |
| 524 | impl 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 | |
| 553 | pub fn rl( |
nothing calls this directly
no test coverage detected