From: Simon Tatham Date: Sat, 27 Jan 2024 11:50:26 +0000 (+0000) Subject: Make [ESC][Y][V] go to the Error Log. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=23478868ba16ecf904b5320c5ff4d74199468b6c;p=mastodonochrome.git Make [ESC][Y][V] go to the Error Log. I put that keypath in the file title, so I shouldn't have forgotten to make it actually work! --- diff --git a/src/file.rs b/src/file.rs index 887a66b..9fc7dad 100644 --- a/src/file.rs +++ b/src/file.rs @@ -441,6 +441,7 @@ struct File { search_direction: Option, last_search: Option, latest_read_index: Option, + our_account_id: String, // for reference when we don't have a Client } impl File { @@ -533,6 +534,7 @@ impl File { search_direction: None, last_search: None, latest_read_index, + our_account_id: client.our_account_id(), } } @@ -1270,7 +1272,13 @@ impl ActivityState fs }; let fs = if Type::IS_EXAMINE_USER { - fs.add(Pr('O'), "Options", 41) + let fs = fs.add(Pr('O'), "Options", 41); + if self.contents.source.single_id() == self.our_account_id + { + fs.add(Pr('V'), "View Errors", 1) + } else { + fs + } } else { fs }; @@ -1608,6 +1616,17 @@ impl ActivityState } } + Pr('v') | Pr('V') => { + if Type::IS_EXAMINE_USER + && self.contents.source.single_id() + == self.our_account_id + { + LogicalAction::Goto(UtilityActivity::ErrorLog.into()) + } else { + LogicalAction::Nothing + } + } + _ => LogicalAction::Nothing, }, UIMode::ListSubmenu => match key {