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)]
|
||||
impl Renderer {
|
||||
pub fn new(layout: RenderLayoutKind) -> Self {
|
||||
todo!("Fix renderer idx in select mode");
|
||||
Self {
|
||||
buffer: String::new(),
|
||||
exit: false,
|
||||
@ -151,21 +152,21 @@ impl Renderer {
|
||||
|
||||
pub fn handle_arrow_key(&mut self, key: KeyCode) {
|
||||
match &mut self.mode {
|
||||
InputMode::Input => {}
|
||||
InputMode::PopUp(content, .., idx) => {
|
||||
log(msg!(DEBUG, "Received keycode: {key}"));
|
||||
log(msg!(DEBUG, "idx before: {idx}"));
|
||||
match key {
|
||||
KeyCode::Up => { *idx = idx.saturating_sub(1) }
|
||||
KeyCode::Down => {
|
||||
if *idx < content.len().saturating_sub(1) {
|
||||
*idx += 1;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
InputMode::Input => {}
|
||||
InputMode::PopUp(ref content, .., idx) => {
|
||||
log(msg!(DEBUG, "Received keycode: {key}"));
|
||||
log(msg!(DEBUG, "idx before: {idx}"));
|
||||
match key {
|
||||
KeyCode::Up => { *idx = idx.saturating_sub(1) }
|
||||
KeyCode::Down => {
|
||||
if *idx < content.len() {
|
||||
*idx += 1;
|
||||
}
|
||||
log(msg!(DEBUG, "idx after: {idx}"))
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
log(msg!(DEBUG, "idx after: {idx}"))
|
||||
}
|
||||
}
|
||||
if let Some(pane) = self.focused() {
|
||||
match &pane.target {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user