diff options
author | Christian Duerr <contact@christianduerr.com> | 2018-03-08 22:50:04 +0100 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2018-03-12 23:21:19 -0700 |
commit | f936f40ad2326324cf3c4af14cc380a6ebbc5b56 (patch) | |
tree | a83929c2334401f3918772ac657fc54e6a12c366 /src/ansi.rs | |
parent | b7e0005334da5969e64eccb35517d63e4dd69f8e (diff) | |
download | alacritty-f936f40ad2326324cf3c4af14cc380a6ebbc5b56.tar.gz alacritty-f936f40ad2326324cf3c4af14cc380a6ebbc5b56.zip |
Add modifiers to mouse events
This commits adds modifiers to the mouse events.
It's an attempt at merging https://github.com/jwilm/alacritty/pull/1141
into this branch/PR.
Diffstat (limited to 'src/ansi.rs')
-rw-r--r-- | src/ansi.rs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/ansi.rs b/src/ansi.rs index b59959f5..dbc361a8 100644 --- a/src/ansi.rs +++ b/src/ansi.rs @@ -876,7 +876,6 @@ impl<'a, H, W> vte::Perform for Performer<'a, H, W> let handler = &mut self.handler; let writer = &mut self.writer; - macro_rules! unhandled { () => {{ warn!("[Unhandled CSI] action={:?}, args={:?}, intermediates={:?}", @@ -959,10 +958,12 @@ impl<'a, H, W> vte::Perform for Performer<'a, H, W> 'T' => handler.scroll_down(Line(arg_or_default!(idx: 0, default: 1) as usize)), 'L' => handler.insert_blank_lines(Line(arg_or_default!(idx: 0, default: 1) as usize)), 'l' => { - let mode = Mode::from_primitive(private, arg_or_default!(idx: 0, default: 0)); - match mode { - Some(mode) => handler.unset_mode(mode), - None => unhandled!(), + for arg in args { + let mode = Mode::from_primitive(private, *arg); + match mode { + Some(mode) => handler.unset_mode(mode), + None => unhandled!(), + } } }, 'M' => handler.delete_lines(Line(arg_or_default!(idx: 0, default: 1) as usize)), @@ -971,10 +972,12 @@ impl<'a, H, W> vte::Perform for Performer<'a, H, W> 'Z' => handler.move_backward_tabs(arg_or_default!(idx: 0, default: 1)), 'd' => handler.goto_line(Line(arg_or_default!(idx: 0, default: 1) as usize - 1)), 'h' => { - let mode = Mode::from_primitive(private, arg_or_default!(idx: 0, default: 0)); - match mode { - Some(mode) => handler.set_mode(mode), - None => unhandled!(), + for arg in args { + let mode = Mode::from_primitive(private, *arg); + match mode { + Some(mode) => handler.set_mode(mode), + None => unhandled!(), + } } }, 'm' => { @@ -985,7 +988,6 @@ impl<'a, H, W> vte::Perform for Performer<'a, H, W> return; } loop { - // println!("args.len = {}; i={}", args.len(), i); if i >= args.len() { // C-for condition break; } |