input: Fix crash for weird bracketed paste

I can reproduce by pasting after

```fish
echo \cc foo | fish_clipboard_copy
```

in Wezterm
This commit is contained in:
Fabian Boehm 2024-04-03 16:28:52 +02:00
parent cb58a30bf2
commit e8eb4822ce

View file

@ -463,7 +463,9 @@ impl InputEventQueuer for Inputter {
}
fn paste_commit(&mut self) {
self.push_front(CharEvent::from_readline(ReadlineCmd::EndUndoGroup));
let buffer = self.paste_buffer.take().unwrap();
let Some(buffer) = self.paste_buffer.take() else {
return;
};
self.push_front(CharEvent::Command(sprintf!(
"__fish_paste %s",
escape(&str2wcstring(&buffer))