|
|
@ -42,7 +42,7 @@ impl EditorView {
|
|
|
|
viewport.x + OFFSET,
|
|
|
|
viewport.x + OFFSET,
|
|
|
|
viewport.y,
|
|
|
|
viewport.y,
|
|
|
|
viewport.width - OFFSET,
|
|
|
|
viewport.width - OFFSET,
|
|
|
|
viewport.height - 1,
|
|
|
|
viewport.height.saturating_sub(1),
|
|
|
|
); // - 1 for statusline
|
|
|
|
); // - 1 for statusline
|
|
|
|
self.render_buffer(view, area, surface, theme, is_focused);
|
|
|
|
self.render_buffer(view, area, surface, theme, is_focused);
|
|
|
|
|
|
|
|
|
|
|
@ -52,7 +52,7 @@ impl EditorView {
|
|
|
|
|
|
|
|
|
|
|
|
let area = Rect::new(
|
|
|
|
let area = Rect::new(
|
|
|
|
viewport.x,
|
|
|
|
viewport.x,
|
|
|
|
viewport.y + viewport.height - 1,
|
|
|
|
viewport.y + viewport.height.saturating_sub(1),
|
|
|
|
viewport.width,
|
|
|
|
viewport.width,
|
|
|
|
1,
|
|
|
|
1,
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -433,14 +433,16 @@ impl Component for EditorView {
|
|
|
|
// Mode::Insert => write!(stdout, "\x1B[6 q"),
|
|
|
|
// Mode::Insert => write!(stdout, "\x1B[6 q"),
|
|
|
|
// mode => write!(stdout, "\x1B[2 q"),
|
|
|
|
// mode => write!(stdout, "\x1B[2 q"),
|
|
|
|
// };
|
|
|
|
// };
|
|
|
|
let view = editor.view();
|
|
|
|
// let view = editor.view();
|
|
|
|
let cursor = view.doc.selection().cursor();
|
|
|
|
// let cursor = view.doc.selection().cursor();
|
|
|
|
|
|
|
|
|
|
|
|
let mut pos = view
|
|
|
|
// if let Some(mut pos) = view.screen_coords_at_pos(view.doc.text().slice(..), cursor) {
|
|
|
|
.screen_coords_at_pos(view.doc.text().slice(..), cursor)
|
|
|
|
// pos.col += view.area.x as usize + area.x as usize + OFFSET as usize;
|
|
|
|
.expect("Cursor is out of bounds.");
|
|
|
|
// pos.row += view.area.y as usize + area.y as usize;
|
|
|
|
pos.col += view.area.x as usize + area.x as usize + OFFSET as usize;
|
|
|
|
// return Some(pos);
|
|
|
|
pos.row += view.area.y as usize + area.y as usize;
|
|
|
|
// }
|
|
|
|
Some(pos)
|
|
|
|
|
|
|
|
|
|
|
|
// It's easier to just not render the cursor and use selection rendering instead.
|
|
|
|
|
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|