aboutsummaryrefslogtreecommitdiff
path: root/src/bibiman.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bibiman.rs')
-rw-r--r--src/bibiman.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/bibiman.rs b/src/bibiman.rs
index 3bb731b..988bac8 100644
--- a/src/bibiman.rs
+++ b/src/bibiman.rs
@@ -15,12 +15,15 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
/////
+use crate::app::App;
use crate::bibiman::{bibisetup::*, search::BibiSearch};
use crate::cliargs::CLIArgs;
+use crate::tui::commandnew::CmdAction;
use crate::{bibiman::entries::EntryTable, bibiman::keywords::TagList};
use arboard::Clipboard;
use color_eyre::eyre::{Ok, Result};
use std::path::PathBuf;
+use tui_input::Input;
pub mod bibisetup;
pub mod entries;
@@ -94,7 +97,7 @@ impl Bibiman {
self.entry_table = EntryTable::new(self.main_biblio.entry_list.clone());
}
- // Toggle moveable list between entries and tags
+ /// Toggle moveable list between entries and tags
pub fn toggle_area(&mut self) {
if let CurrentArea::EntryArea = self.current_area {
self.entry_table.entry_scroll_state = self.entry_table.entry_scroll_state.position(0);
@@ -220,4 +223,14 @@ impl Bibiman {
self.search_tags();
}
}
+
+ pub fn search_list_by_pattern(&mut self, searchpattern: &Input) {
+ self.search_struct.search_string = searchpattern.value().to_string();
+ if let Some(FormerArea::EntryArea) = self.former_area {
+ self.search_entries();
+ self.filter_tags_by_entries();
+ } else if let Some(FormerArea::TagArea) = self.former_area {
+ self.search_tags();
+ }
+ }
}