diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-04-25 14:20:01 -0400 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-04-25 14:20:01 -0400 |
commit | 98e7abe8b451448305a4753dcad1bc56b2892a1b (patch) | |
tree | 2480fd7123574b92d08c5e46ebf78f17492d0e69 /src/context | |
parent | a0fd0d5ec9cc023674099be44a2feea08879b0e9 (diff) |
add back option to string search instead of always glob search
- search will be used for string search
- search_glob will be used for glob search
Diffstat (limited to 'src/context')
-rw-r--r-- | src/context/context.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/context/context.rs b/src/context/context.rs index 14e262f..09e9c56 100644 --- a/src/context/context.rs +++ b/src/context/context.rs @@ -5,6 +5,7 @@ use std::thread; use globset::GlobMatcher; +use crate::commands::SearchPattern; use crate::config; use crate::context::{LocalStateContext, TabContext}; use crate::io::{IoWorkerObserver, IoWorkerProgress, IoWorkerThread}; @@ -16,7 +17,7 @@ pub struct JoshutoContext { events: Events, tab_context: TabContext, local_state: Option<LocalStateContext>, - search_state: Option<GlobMatcher>, + search_state: Option<SearchPattern>, message_queue: VecDeque<String>, worker_queue: VecDeque<IoWorkerThread>, worker: Option<IoWorkerObserver>, @@ -81,11 +82,11 @@ impl JoshutoContext { self.local_state.take() } - pub fn set_search_state(&mut self, pattern: GlobMatcher) { + pub fn set_search_state(&mut self, pattern: SearchPattern) { self.search_state = Some(pattern); } - pub fn get_search_state(&self) -> Option<&GlobMatcher> { + pub fn get_search_state(&self) -> Option<&SearchPattern> { self.search_state.as_ref() } |