diff options
author | Canop <cano.petrole@gmail.com> | 2022-03-27 20:48:30 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2022-03-27 20:48:30 +0200 |
commit | a697c79919301313a6942808363f5a9483c3b1d7 (patch) | |
tree | e5d718af7d3a67028302411c7206fbc8a1d41c2f /src/command | |
parent | a9c90d1d98d52db4e27f0484303dc157b431519c (diff) |
verb filtering by file extension
Fix #508
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/panel_input.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/command/panel_input.rs b/src/command/panel_input.rs index 6ccc57a..f1a9406 100644 --- a/src/command/panel_input.rs +++ b/src/command/panel_input.rs @@ -328,6 +328,12 @@ impl PanelInput { if mode != Mode::Input && verb.is_internal(Internal::mode_input) { self.enter_input_mode_with_key(key, &parts); } + if !verb.file_extensions.is_empty() { + let extension = sel_info.extension(); + if !extension.map_or(false, |ext| verb.file_extensions.iter().any(|ve| ve == ext)) { + continue; + } + } if verb.auto_exec { return Command::VerbTrigger { index, |