Prompt editor for cursor row
This commit is contained in:
parent
aa25def749
commit
e93c29b839
1 changed files with 7 additions and 0 deletions
|
|
@ -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]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue