summaryrefslogtreecommitdiffstats
path: root/src/pattern
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2022-05-04 20:40:46 +0200
committerCanop <cano.petrole@gmail.com>2022-05-04 20:40:46 +0200
commitc76be097397df82ed62582546ef76bbbf5203819 (patch)
tree6cd7b03037e30b649a4e3be41d5ca5fe6935ca1f /src/pattern
parente737f692ffaa4808813b37c6c51b06e6195cb875 (diff)
add the :stage_all_files internal
Default mapping: ctrl-a
Diffstat (limited to 'src/pattern')
-rw-r--r--src/pattern/input_pattern.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pattern/input_pattern.rs b/src/pattern/input_pattern.rs
index d5e6c39..d8729e4 100644
--- a/src/pattern/input_pattern.rs
+++ b/src/pattern/input_pattern.rs
@@ -50,6 +50,13 @@ impl InputPattern {
pub fn take(&mut self) -> Self {
std::mem::replace(self, Self::none())
}
+ pub fn as_option(self) -> Option<Self> {
+ if self.is_some() {
+ Some(self)
+ } else {
+ None
+ }
+ }
/// from a pattern used to filter a tree, build a pattern
/// which would make sense to filter a previewed file
pub fn tree_to_preview(&self) -> Self {