parser: fix panic on zero mouse coordinate reports
This commit is contained in:
parent
1b957ec84e
commit
a75cce6e78
1 changed files with 2 additions and 2 deletions
|
@ -260,8 +260,8 @@ pub fn parse(self: *Parser, input: []const u8, paste_allocator: ?std.mem.Allocat
|
||||||
const shift = seq.params[0] & mouse_bits.shift > 0;
|
const shift = seq.params[0] & mouse_bits.shift > 0;
|
||||||
const alt = seq.params[0] & mouse_bits.alt > 0;
|
const alt = seq.params[0] & mouse_bits.alt > 0;
|
||||||
const ctrl = seq.params[0] & mouse_bits.ctrl > 0;
|
const ctrl = seq.params[0] & mouse_bits.ctrl > 0;
|
||||||
const col: usize = seq.params[1] - 1;
|
const col: usize = if(seq.params[1] > 0) seq.params[1] - 1 else 0;
|
||||||
const row: usize = seq.params[2] - 1;
|
const row: usize = if(seq.params[2] > 0) seq.params[2] - 1 else 0;
|
||||||
|
|
||||||
const mouse = Mouse{
|
const mouse = Mouse{
|
||||||
.button = button,
|
.button = button,
|
||||||
|
|
Loading…
Reference in a new issue