fix bracketed paste (#577)

This commit is contained in:
WindSoilder 2023-05-03 03:54:09 +08:00 committed by GitHub
parent ec002a7ce8
commit 65c4e7a419
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -156,7 +156,9 @@ impl EditMode for Emacs {
Event::Resize(width, height) => ReedlineEvent::Resize(width, height),
Event::FocusGained => ReedlineEvent::None,
Event::FocusLost => ReedlineEvent::None,
Event::Paste(body) => ReedlineEvent::Edit(vec![EditCommand::InsertString(body)]),
Event::Paste(body) => ReedlineEvent::Edit(vec![EditCommand::InsertString(
body.replace("\r\n", "\n").replace('\r', "\n"),
)]),
}
}

View File

@ -153,7 +153,9 @@ impl EditMode for Vi {
Event::Resize(width, height) => ReedlineEvent::Resize(width, height),
Event::FocusGained => ReedlineEvent::None,
Event::FocusLost => ReedlineEvent::None,
Event::Paste(body) => ReedlineEvent::Edit(vec![EditCommand::InsertString(body)]),
Event::Paste(body) => ReedlineEvent::Edit(vec![EditCommand::InsertString(
body.replace("\r\n", "\n").replace('\r', "\n"),
)]),
}
}