diff options
author | Christian Duerr <contact@christianduerr.com> | 2021-01-24 21:45:36 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-24 21:45:36 +0000 |
commit | 530de00049c2afcc562d36ccdb3e6afa2fe396a5 (patch) | |
tree | 3dabbcef3fc4a2041f9027d82243aa0d70928153 /alacritty_terminal/src/ansi.rs | |
parent | 7291702f6b4fff10f2470f084abe0785b95659a0 (diff) | |
download | r-alacritty-530de00049c2afcc562d36ccdb3e6afa2fe396a5.tar.gz r-alacritty-530de00049c2afcc562d36ccdb3e6afa2fe396a5.tar.bz2 r-alacritty-530de00049c2afcc562d36ccdb3e6afa2fe396a5.zip |
Move renderable cell transformation to alacritty
This refactors a large chunk of the alacritty_terminal API to expose all
data necessary for rendering uniformly through the `renderable_content`
call. This also no longer transforms the cells for rendering by a GUI
but instead just reports the content from a terminal emulation
perspective. The transformation into renderable cells is now done inside
the alacritty crate.
Since the terminal itself only ever needs to know about modified color
RGB values, the configuration for colors was moved to the alacritty UI
code.
Diffstat (limited to 'alacritty_terminal/src/ansi.rs')
-rw-r--r-- | alacritty_terminal/src/ansi.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs index 2bd445ea..8f2264af 100644 --- a/alacritty_terminal/src/ansi.rs +++ b/alacritty_terminal/src/ansi.rs @@ -306,7 +306,7 @@ pub trait Handler { fn set_color(&mut self, _: usize, _: Rgb) {} /// Write a foreground/background color escape sequence with the current color. - fn dynamic_color_sequence<W: io::Write>(&mut self, _: &mut W, _: u8, _: usize, _: &str) {} + fn dynamic_color_sequence(&mut self, _: u8, _: usize, _: &str) {} /// Reset an indexed color to original value. fn reset_color(&mut self, _: usize) {} @@ -778,10 +778,10 @@ where } #[inline] - fn hook(&mut self, params: &Params, intermediates: &[u8], ignore: bool, _c: char) { + fn hook(&mut self, params: &Params, intermediates: &[u8], ignore: bool, action: char) { debug!( - "[unhandled hook] params={:?}, ints: {:?}, ignore: {:?}", - params, intermediates, ignore + "[unhandled hook] params={:?}, ints: {:?}, ignore: {:?}, action: {:?}", + params, intermediates, ignore, action ); } @@ -798,7 +798,6 @@ where // TODO replace OSC parsing with parser combinators. #[inline] fn osc_dispatch(&mut self, params: &[&[u8]], bell_terminated: bool) { - let writer = &mut self.writer; let terminator = if bell_terminated { "\x07" } else { "\x1b\\" }; fn unhandled(params: &[&[u8]]) { @@ -868,7 +867,6 @@ where self.handler.set_color(index, color); } else if param == b"?" { self.handler.dynamic_color_sequence( - writer, dynamic_code, index, terminator, |