aboutsummaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
authorlukeflo2024-11-17 21:04:19 +0100
committerlukeflo2024-11-17 21:04:19 +0100
commitdc250eac78d3806f587c77a42735ae65e455b71f (patch)
treef3395b32012c843dda732689808532c78ae8fc96 /src/app.rs
parent13bb655e3d63cf9e324ca055720d2fdb65e6b76e (diff)
downloadbibiman-dc250eac78d3806f587c77a42735ae65e455b71f.tar.gz
bibiman-dc250eac78d3806f587c77a42735ae65e455b71f.zip
working selection popup, but ugly field values
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/app.rs b/src/app.rs
index 7141ead..596420e 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -15,7 +15,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
/////
-use crate::bibiman::{CurrentArea, FormerArea};
+use crate::bibiman::{self, CurrentArea, FormerArea};
// use super::Event;
use crate::cliargs::CLIArgs;
use crate::tui::commands::InputCmdAction;
@@ -23,7 +23,6 @@ use crate::tui::popup::PopupKind;
use crate::tui::{self, Tui};
use crate::{bibiman::Bibiman, tui::commands::CmdAction};
use color_eyre::eyre::{Ok, Result};
-use color_eyre::owo_colors::colors::css::LemonChiffon;
use tui::Event;
use tui_input::backend::crossterm::EventHandler;
use tui_input::Input;
@@ -222,6 +221,9 @@ impl App {
if let Some(PopupKind::Help) = self.bibiman.popup_area.popup_kind {
self.bibiman.close_popup();
} else if let Some(PopupKind::Selection) = self.bibiman.popup_area.popup_kind {
+ let idx = self.bibiman.popup_area.popup_state.selected().unwrap();
+ let object = self.bibiman.popup_area.popup_list[idx].as_str();
+ bibiman::open_connected_res(object)?;
// run command to open file/Url
self.bibiman.close_popup()
}
@@ -272,7 +274,8 @@ impl App {
}
self.bibiman.popup_area.popup_selection(items);
self.bibiman.former_area = Some(FormerArea::EntryArea);
- self.bibiman.current_area = CurrentArea::PopupArea
+ self.bibiman.current_area = CurrentArea::PopupArea;
+ self.bibiman.popup_area.popup_state.select(Some(0))
}
}
// match ressource {