fix #289: crash on sample dir Add button press

This commit is contained in:
Scott Lamb
2023-08-03 15:57:51 -05:00
parent 0f019b6fb3
commit 02ac1a5570
3 changed files with 8 additions and 1 deletions

View File

@@ -266,7 +266,7 @@ fn add_dir_dialog(db: &Arc<db::Database>, siv: &mut Cursive) {
let db = db.clone();
move |siv| {
let path = siv
.find_name::<views::EditView>("path")
.find_name::<TabCompleteEditView>("path")
.unwrap()
.get_content();
add_dir(&db, siv, path.as_ref().as_ref())

View File

@@ -32,6 +32,10 @@ impl TabCompleteEditView {
self.tab_completer = Some(Rc::new(handler));
self
}
pub fn get_content(&self) -> Rc<String> {
self.edit_view.borrow_mut().get_content()
}
}
impl View for TabCompleteEditView {