@@ -14,7 +14,7 @@ use std::time::Duration;
14use anyhow::Error;
14use anyhow::Error;
16use crate::{keymap, Args};
16use crate::{keymap, Args};
17−use helix_core::{Buffer, State};
17+use helix_core::{state::coords_at_pos, Buffer, State};
19pub struct BufferComponent<'a> {
19pub struct BufferComponent<'a> {
@@ -37,8 +37,7 @@ impl BufferComponent<'_> {
37 SetForegroundColor(Color::Reset),
37 SetForegroundColor(Color::Reset),
38 cursor::MoveTo(self.x + 2, self.y + line_count),
38 cursor::MoveTo(self.x + 2, self.y + line_count),
39 Print(line)
39 Print(line)
42 line_count += 1;
41 line_count += 1;
@@ -117,6 +116,16 @@ impl Editor {
117 // TODO: handle count other than 1
116 // TODO: handle count other than 1
118 command(state, 1);
117 command(state, 1);
119 self.render();
118 self.render();
119+ // render the cursor
120+ let pos = self.state.as_ref().unwrap().selection.primary().head;
121+ let coords = coords_at_pos(
122+ &self.state.as_ref().unwrap().doc.contents.slice(..),
127+ cursor::MoveTo((coords.1 + 2) as u16, coords.0 as u16)