From 61e7f2d0fe21f8ec6d9961d68d5254aca348c3dd Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 2 Mar 2019 09:40:05 -0800 Subject: [PATCH] slightly refine some mouse processing code --- term/src/terminalstate.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/term/src/terminalstate.rs b/term/src/terminalstate.rs index 549dae625..3f870c4a3 100644 --- a/term/src/terminalstate.rs +++ b/term/src/terminalstate.rs @@ -529,7 +529,7 @@ impl TerminalState { if self.sgr_mouse { write_all( writer, - &format!("\x1b[<{};{};{}M", report_button, event.x + 1, event.y + 1).as_bytes(), + format!("\x1b[<{};{};{}M", report_button, event.x + 1, event.y + 1).as_bytes(), )?; } else if self.screen.is_alt_screen_active() { // Send cursor keys instead (equivalent to xterm's alternateScroll mode) @@ -559,11 +559,7 @@ impl TerminalState { )?; } else if event.button == MouseButton::Middle { let clip = host.get_clipboard()?; - if self.bracketed_paste { - write!(host.writer(), "\x1b[200~{}\x1b[201~", clip)?; - } else { - write!(host.writer(), "{}", clip)?; - } + self.send_paste(&clip, host.writer())? } }