From 143cfe13e05b17840a9f2c69417ed98bc3b8cb0e Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Tue, 16 Mar 2021 15:30:29 +0900 Subject: minor: TODO comment cleanup --- helix-term/src/ui/editor.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'helix-term/src/ui') diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 31a19649..eb951a26 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -124,6 +124,9 @@ impl EditorView { use helix_core::graphemes::{grapheme_width, RopeGraphemes}; + // TODO: scope matching: biggest union match? [string] & [html, string], [string, html] & [ string, html] + // can do this by sorting our theme matches based on array len (longest first) then stopping at the + // first rule that matches (rule.all(|scope| scopes.contains(scope))) let style = match spans.first() { Some(span) => theme.get(theme.scopes()[span.0].as_str()), None => Style::default().fg(Color::Rgb(164, 160, 232)), // lavender @@ -138,8 +141,6 @@ impl EditorView { // iterate over range char by char for grapheme in RopeGraphemes::new(text) { - // TODO: track current char_index - if grapheme == "\n" { visual_x = 0; line += 1; @@ -433,9 +434,7 @@ impl Component for EditorView { Event::Key(event) => { let view = cx.editor.view_mut(); - // TODO: sequences (`gg`) let mode = view.doc.mode(); - // TODO: handle count other than 1 let mut cxt = commands::Context { executor: cx.executor, editor: &mut cx.editor, @@ -479,8 +478,6 @@ impl Component for EditorView { if let Some(command) = self.keymap[&mode].get(&event) { command(&mut cxt); - - // TODO: simplistic ensure cursor in view for now } } } @@ -503,7 +500,6 @@ impl Component for EditorView { fn render(&self, mut area: Rect, surface: &mut Surface, cx: &mut Context) { for (view, is_focused) in cx.editor.tree.views() { - // TODO: use parent area self.render_view(view, view.area, surface, &cx.editor.theme, is_focused); } } -- cgit v1.2.3-70-g09d2