diff --git a/alacritty_terminal/src/event_loop.rs b/alacritty_terminal/src/event_loop.rs index 4941b47..275d752 100644 --- a/alacritty_terminal/src/event_loop.rs +++ b/alacritty_terminal/src/event_loop.rs @@ -426,7 +426,6 @@ where } // The evented instances are not dropped here so deregister them explicitly - // TODO: Is this still necessary? let _ = self.poll.deregister(&self.rx); let _ = self.pty.deregister(&self.poll); diff --git a/alacritty_terminal/src/input.rs b/alacritty_terminal/src/input.rs index e87a70a..58480ba 100644 --- a/alacritty_terminal/src/input.rs +++ b/alacritty_terminal/src/input.rs @@ -45,8 +45,6 @@ pub const FONT_SIZE_STEP: f32 = 0.5; /// /// An escape sequence may be emitted in case specific keys or key combinations /// are activated. -/// -/// TODO also need terminal state when processing input pub struct Processor<'a, A: 'a> { pub key_bindings: &'a [KeyBinding], pub mouse_bindings: &'a [MouseBinding], diff --git a/alacritty_terminal/src/renderer/mod.rs b/alacritty_terminal/src/renderer/mod.rs index da2dfed..4aae853 100644 --- a/alacritty_terminal/src/renderer/mod.rs +++ b/alacritty_terminal/src/renderer/mod.rs @@ -32,8 +32,9 @@ use crate::gl; use crate::gl::types::*; use crate::index::{Column, Line}; use crate::renderer::rects::RenderRect; +use crate::term::cell::{self, Flags}; use crate::term::color::Rgb; -use crate::term::{self, cell, RenderableCell, RenderableCellContent}; +use crate::term::{self, RenderableCell, RenderableCellContent}; pub mod rects; @@ -977,7 +978,7 @@ impl<'a> RenderApi<'a> { }), bg: color.unwrap_or(Rgb { r: 0, g: 0, b: 0 }), fg: Rgb { r: 0, g: 0, b: 0 }, - flags: cell::Flags::empty(), + flags: Flags::empty(), bg_alpha, }) .collect::>(); @@ -1026,19 +1027,15 @@ impl<'a> RenderApi<'a> { }; // Get font key for cell - // FIXME this is super inefficient. - let font_key = match ( - cell.flags.contains(cell::Flags::BOLD), - cell.flags.contains(cell::Flags::ITALIC), - ) { - (false, false) => glyph_cache.font_key, - (true, false) => glyph_cache.bold_key, - (false, true) => glyph_cache.italic_key, - (true, true) => glyph_cache.bold_italic_key, + let font_key = match cell.flags & Flags::BOLD_ITALIC { + Flags::BOLD_ITALIC => glyph_cache.bold_italic_key, + Flags::ITALIC => glyph_cache.italic_key, + Flags::BOLD => glyph_cache.bold_key, + _ => glyph_cache.font_key, }; // Don't render text of HIDDEN cells - let mut chars = if cell.flags.contains(cell::Flags::HIDDEN) { + let mut chars = if cell.flags.contains(Flags::HIDDEN) { [' '; cell::MAX_ZEROWIDTH_CHARS + 1] } else { chars diff --git a/alacritty_terminal/src/term/cell.rs b/alacritty_terminal/src/term/cell.rs index 8d1b135..7a75977 100644 --- a/alacritty_terminal/src/term/cell.rs +++ b/alacritty_terminal/src/term/cell.rs @@ -26,6 +26,7 @@ bitflags! { const INVERSE = 0b00_0000_0001; const BOLD = 0b00_0000_0010; const ITALIC = 0b00_0000_0100; + const BOLD_ITALIC = 0b00_0000_0110; const UNDERLINE = 0b00_0000_1000; const WRAPLINE = 0b00_0001_0000; const WIDE_CHAR = 0b00_0010_0000; diff --git a/font/src/darwin/mod.rs b/font/src/darwin/mod.rs index faef106..4292765 100644 --- a/font/src/darwin/mod.rs +++ b/font/src/darwin/mod.rs @@ -13,8 +13,6 @@ // limitations under the License. // //! Font rendering based on CoreText -//! -//! TODO error handling... just search for unwrap. #![allow(improper_ctypes)] use std::collections::HashMap; use std::path::PathBuf;