Prompt editor for cursor row

This commit is contained in:
Joscha 2022-07-28 11:46:10 +02:00
parent aa25def749
commit e93c29b839

View file

@ -261,6 +261,13 @@ impl Editor {
(row, line_idx) (row, line_idx)
} }
pub fn cursor_row(&self, frame: &mut Frame) -> usize {
let width: usize = frame.size().width.into();
let indices = frame.wrap(&self.text.text(), width);
let (row, _) = Self::wrapped_cursor(self.idx, &indices);
row
}
} }
#[async_trait] #[async_trait]