need to fix pop selection in renderer
This commit is contained in:
parent
df67c432f3
commit
5df4c42a7a
@ -53,6 +53,7 @@ pub enum RenderCommand {
|
|||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
impl Renderer {
|
impl Renderer {
|
||||||
pub fn new(layout: RenderLayoutKind) -> Self {
|
pub fn new(layout: RenderLayoutKind) -> Self {
|
||||||
|
todo!("Fix renderer idx in select mode");
|
||||||
Self {
|
Self {
|
||||||
buffer: String::new(),
|
buffer: String::new(),
|
||||||
exit: false,
|
exit: false,
|
||||||
@ -152,13 +153,13 @@ impl Renderer {
|
|||||||
pub fn handle_arrow_key(&mut self, key: KeyCode) {
|
pub fn handle_arrow_key(&mut self, key: KeyCode) {
|
||||||
match &mut self.mode {
|
match &mut self.mode {
|
||||||
InputMode::Input => {}
|
InputMode::Input => {}
|
||||||
InputMode::PopUp(content, .., idx) => {
|
InputMode::PopUp(ref content, .., idx) => {
|
||||||
log(msg!(DEBUG, "Received keycode: {key}"));
|
log(msg!(DEBUG, "Received keycode: {key}"));
|
||||||
log(msg!(DEBUG, "idx before: {idx}"));
|
log(msg!(DEBUG, "idx before: {idx}"));
|
||||||
match key {
|
match key {
|
||||||
KeyCode::Up => { *idx = idx.saturating_sub(1) }
|
KeyCode::Up => { *idx = idx.saturating_sub(1) }
|
||||||
KeyCode::Down => {
|
KeyCode::Down => {
|
||||||
if *idx < content.len().saturating_sub(1) {
|
if *idx < content.len() {
|
||||||
*idx += 1;
|
*idx += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user