diff options
author | Christian Duerr <contact@christianduerr.com> | 2019-09-21 19:54:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-21 19:54:32 +0200 |
commit | 856cddc8739c32d8bbfff72dd3692f49359142a9 (patch) | |
tree | e7428984c5fcd51cfccd7e78a864497bd87c8e60 | |
parent | 71a818cb8fcc99d1d9176fca3b3386c6971a306a (diff) | |
download | alacritty-856cddc8739c32d8bbfff72dd3692f49359142a9.tar.gz alacritty-856cddc8739c32d8bbfff72dd3692f49359142a9.zip |
Remove outdated TODO/FIXME comments
-rw-r--r-- | alacritty_terminal/src/event_loop.rs | 1 | ||||
-rw-r--r-- | alacritty_terminal/src/input.rs | 2 | ||||
-rw-r--r-- | alacritty_terminal/src/renderer/mod.rs | 21 | ||||
-rw-r--r-- | alacritty_terminal/src/term/cell.rs | 1 | ||||
-rw-r--r-- | font/src/darwin/mod.rs | 2 |
5 files changed, 10 insertions, 17 deletions
diff --git a/alacritty_terminal/src/event_loop.rs b/alacritty_terminal/src/event_loop.rs index 4941b479..275d752c 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 e87a70a8..58480bac 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 da2dfed1..4aae8536 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::<Vec<_>>(); @@ -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 8d1b135c..7a759777 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 faef1065..42927654 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; |