terminal: Consume event during processing (#30869)
By consuming the event during processing we save a few clones during event processing. Overall in this PR we save one Clone each during: - Paste to the terminal - Writing to the terminal - Setting the title - On every terminal transaction - On every ViMotion when not using shift Release Notes: - N/A
This commit is contained in:
parent
c50093d68c
commit
4266f0da85
3 changed files with 24 additions and 22 deletions
|
@ -193,7 +193,8 @@ impl TerminalTransaction {
|
|||
});
|
||||
}
|
||||
|
||||
fn sanitize_input(input: String) -> String {
|
||||
input.replace(['\r', '\n'], "")
|
||||
fn sanitize_input(mut input: String) -> String {
|
||||
input.retain(|c| c != '\r' && c != '\n');
|
||||
input
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue