Add set_seen shortcut in CompactListing

embed
Manos Pitsidianakis 2019-09-29 01:55:39 +03:00
parent c7bcb9e553
commit 2b5472adc3
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 14 additions and 0 deletions

View File

@ -1093,6 +1093,12 @@ impl Component for CompactListing {
self.movement = Some(PageMovement::End);
self.set_dirty();
}
UIEvent::Input(ref key) if *key == shortcuts["set_seen"] => {
let thread_hash = self.get_thread_under_cursor(self.cursor_pos.2, context);
self.perform_action(context, thread_hash, &ListingAction::SetSeen);
self.row_updates.push(thread_hash);
self.set_dirty();
}
UIEvent::Input(ref k) if self.unfocused && *k == shortcuts["exit_thread"] => {
self.unfocused = false;
self.dirty = true;
@ -1331,6 +1337,14 @@ impl Component for CompactListing {
Key::Char('v')
},
),
(
"set_seen",
if let Some(key) = config_map.get("set_seen") {
(*key).clone()
} else {
Key::Char('n')
},
),
]
.iter()
.cloned()