summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/command/panel_input.rs3
-rw-r--r--src/display/displayable_tree.rs19
2 files changed, 12 insertions, 10 deletions
diff --git a/src/command/panel_input.rs b/src/command/panel_input.rs
index c49244f..192645c 100644
--- a/src/command/panel_input.rs
+++ b/src/command/panel_input.rs
@@ -306,7 +306,8 @@ impl PanelInput {
return Command::from_parts(parts, true);
}
- if key == key!('?') && (raw.is_empty() || parts.verb_invocation.is_some()) {
+ if (key == key!('?') || key == key!(shift-'?'))
+ && (raw.is_empty() || parts.verb_invocation.is_some()) {
// a '?' opens the help when it's the first char
// or when it's part of the verb invocation
return Command::Internal {
diff --git a/src/display/displayable_tree.rs b/src/display/displayable_tree.rs
index 5e8696e..f4f4974 100644
--- a/src/display/displayable_tree.rs
+++ b/src/display/displayable_tree.rs
@@ -18,7 +18,7 @@ use {
task_sync::ComputationResult,
tree::{Tree, TreeLine, TreeLineType},
},
- chrono::{DateTime, Local, TimeZone},
+ chrono::{DateTime, Local, LocalResult, TimeZone},
crokey::crossterm::{
cursor,
QueueableCommand,
@@ -222,14 +222,15 @@ impl<'a, 's, 't> DisplayableTree<'a, 's, 't> {
seconds: i64,
selected: bool,
) -> Result<usize, termimad::Error> {
- let date_time: DateTime<Local> = Local.timestamp(seconds, 0);
- cond_bg!(date_style, self, selected, self.skin.dates);
- cw.queue_g_string(
- date_style,
- date_time
- .format(self.tree.options.date_time_format)
- .to_string(),
- )?;
+ if let LocalResult::Single(date_time) = Local.timestamp_opt(seconds, 0) {
+ cond_bg!(date_style, self, selected, self.skin.dates);
+ cw.queue_g_string(
+ date_style,
+ date_time
+ .format(self.tree.options.date_time_format)
+ .to_string(),
+ )?;
+ }
Ok(1)
}