@@ -185,23 +185,6 @@ impl Editor {
185 // .take(self.size.1 as usize)
185 // .take(self.size.1 as usize)
186 // .map(|x| x.as_str().unwrap());
186 // .map(|x| x.as_str().unwrap());
188− // for (n, line) in lines.enumerate() {
191− // SetForegroundColor(Color::DarkCyan),
192− // cursor::MoveTo(0, n as u16),
193− // Print((n + 1).to_string())
196− // surface.set_string(2, n as u16, line, Style::default());
199− // // SetForegroundColor(Color::Reset),
200− // // cursor::MoveTo(2, n as u16),
205 // // iterate over selections and render them
188 // // iterate over selections and render them
206 // let select = Style::default().bg(tui::style::Color::LightBlue);
189 // let select = Style::default().bg(tui::style::Color::LightBlue);
207 // let text = state.doc.slice(..);
190 // let text = state.doc.slice(..);
@@ -234,7 +217,7 @@ impl Editor {
236 use tui::backend::Backend;
219 use tui::backend::Backend;
237− // // TODO: double buffer and diff here
220+
238 self.terminal
221 self.terminal
239 .backend_mut()
222 .backend_mut()
240 .draw(self.surface.diff(&surface).into_iter());
223 .draw(self.surface.diff(&surface).into_iter());
@@ -296,6 +279,10 @@ impl Editor {
296 code: KeyCode::Char(c),
279 code: KeyCode::Char(c),
298 } => helix_core::commands::insert_char(state, c),
281 } => helix_core::commands::insert_char(state, c),
283+ code: KeyCode::Enter,
285+ } => helix_core::commands::insert_char(state, '\n'),
299 _ => (), // skip
286 _ => (), // skip
301 self.render();
288 self.render();