@@ -52,7 +52,6 @@ impl Editor {
53 surface: Surface::empty(area),
53 surface: Surface::empty(area),
54 cache: Surface::empty(area),
54 cache: Surface::empty(area),
55− // TODO; move to state
58 if let Some(file) = args.values_of_t::<PathBuf>("files").unwrap().pop() {
57 if let Some(file) = args.values_of_t::<PathBuf>("files").unwrap().pop() {
@@ -225,15 +224,7 @@ impl Editor {
225 // lavender
224 // lavender
228− // let lines = state
230− // .lines_at(self.first_line as usize)
231− // .take(self.size.1 as usize)
232− // .map(|x| x.as_str().unwrap());
234 // // iterate over selections and render them
227 // // iterate over selections and render them
235− // let select = Style::default().bg(tui::style::Color::LightBlue);
236− // let text = state.doc.slice(..);
237 // for range in state.selection.ranges() {
228 // for range in state.selection.ranges() {
238 // // get terminal coords for x,y for each range pos
229 // // get terminal coords for x,y for each range pos
239 // // TODO: this won't work with multiline
230 // // TODO: this won't work with multiline
@@ -246,8 +237,6 @@ impl Editor {
246 // (y2 - y1 + 1) as u16,
237 // (y2 - y1 + 1) as u16,
248 // self.surface.set_style(area, select);
239 // self.surface.set_style(area, select);
250− // // TODO: don't highlight next char in append mode
253 // statusline
242 // statusline
@@ -330,13 +319,13 @@ impl Editor {
332 Some(Ok(Event::Key(event))) => {
321 Some(Ok(Event::Key(event))) => {
322+ // TODO: sequences (`gg`)
323+ // TODO: handle count other than 1
333 if let Some(view) = &mut self.view {
324 if let Some(view) = &mut self.view {
334 match view.state.mode() {
325 match view.state.mode() {
335 Mode::Insert => {
326 Mode::Insert => {
336− // TODO: handle modes and sequences (`gg`)
337 let keys = vec![event];
327 let keys = vec![event];
338 if let Some(command) = keymap[&Mode::Insert].get(&keys) {
328 if let Some(command) = keymap[&Mode::Insert].get(&keys) {
339− // TODO: handle count other than 1
340 command(view, 1);
329 command(view, 1);
341 } else if let KeyEvent {
330 } else if let KeyEvent {
342 code: KeyCode::Char(c),
331 code: KeyCode::Char(c),
@@ -350,10 +339,8 @@ impl Editor {
350 self.render();
339 self.render();
352 Mode::Normal => {
341 Mode::Normal => {
353− // TODO: handle modes and sequences (`gg`)
354 let keys = vec![event];
342 let keys = vec![event];
355 if let Some(command) = keymap[&Mode::Normal].get(&keys) {
343 if let Some(command) = keymap[&Mode::Normal].get(&keys) {
356− // TODO: handle count other than 1
357 command(view, 1);
344 command(view, 1);
359 // TODO: simplistic ensure cursor in view for now
346 // TODO: simplistic ensure cursor in view for now