1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-10 15:04:32 +03:00

slightly refine some mouse processing code

This commit is contained in:
Wez Furlong 2019-03-02 09:40:05 -08:00
parent 150225dd22
commit 61e7f2d0fe

View File

@ -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())?
}
}