diff options
author | Canop <cano.petrole@gmail.com> | 2021-01-10 18:30:14 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2021-01-10 18:30:14 +0100 |
commit | e88a91a3250828d77165c5a448751de91ab605d8 (patch) | |
tree | 812a1304012415a258b5ff00346300674680a39c /src/browser/browser_state.rs | |
parent | 03b84adb6045b50cd1161e3338fbdf9890df27e9 (diff) |
experimental "modal mode"modes
Diffstat (limited to 'src/browser/browser_state.rs')
-rw-r--r-- | src/browser/browser_state.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/browser/browser_state.rs b/src/browser/browser_state.rs index 71efe55..a1a23bb 100644 --- a/src/browser/browser_state.rs +++ b/src/browser/browser_state.rs @@ -27,6 +27,7 @@ pub struct BrowserState { pub filtered_tree: Option<Tree>, pub pending_pattern: InputPattern, // a pattern (or not) which has not yet be applied pub total_search_required: bool, // whether the pending pattern should be in total search mode + mode: Mode, } impl BrowserState { @@ -54,6 +55,7 @@ impl BrowserState { filtered_tree: None, pending_pattern, total_search_required: false, + mode: initial_mode(con), })) } @@ -146,6 +148,15 @@ impl BrowserState { impl AppState for BrowserState { + fn set_mode(&mut self, mode: Mode) { + debug!("BrowserState::set_mode({:?})", mode); + self.mode = mode; + } + + fn get_mode(&self) -> Mode { + self.mode + } + fn get_pending_task(&self) -> Option<&'static str> { if self.pending_pattern.is_some() { Some("searching") |