paste: fix bracketed_paste enabling

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
This commit is contained in:
Tim Culverhouse 2024-04-03 18:10:23 -05:00
parent 8f53700302
commit 4118c5f8bc

View file

@ -582,13 +582,10 @@ pub fn Vaxis(comptime T: type) type {
pub fn setBracketedPaste(self: *Self, enable: bool) !void { pub fn setBracketedPaste(self: *Self, enable: bool) !void {
if (self.tty == null) return; if (self.tty == null) return;
self.state.bracketed_paste = enable; self.state.bracketed_paste = enable;
const seq = if (enable) { const seq = if (enable)
self.state.bracketed_paste = true; ctlseqs.bp_set
ctlseqs.bp_set; else
} else {
self.state.bracketed_paste = true;
ctlseqs.bp_reset; ctlseqs.bp_reset;
};
_ = try self.tty.?.write(seq); _ = try self.tty.?.write(seq);
try self.tty.?.flush(); try self.tty.?.flush();
} }