From 4b2ff3686599936a15b45d9e2cbe08ceb8aaf09c Mon Sep 17 00:00:00 2001 From: Michael Sippel Date: Wed, 6 Sep 2023 04:30:56 +0200 Subject: [PATCH] list editor: fix mode view bug --- nested/src/editors/list/editor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nested/src/editors/list/editor.rs b/nested/src/editors/list/editor.rs index b374b48..a269ee2 100644 --- a/nested/src/editors/list/editor.rs +++ b/nested/src/editors/list/editor.rs @@ -52,7 +52,7 @@ impl ListEditor { ListCursorMode::Insert => ip, ListCursorMode::Select => { if let Some(idx) = c.idx { - if idx > 0 && idx < data.len() as isize { + if idx >= 0 && idx < data.len() as isize { data.get(idx as usize).read().unwrap().get_mode_view() } else { eprintln!("ListEditor::mode_port invalid cursor idx");