chiark / gitweb /
Make [ESC][Y][V] go to the Error Log.
authorSimon Tatham <anakin@pobox.com>
Sat, 27 Jan 2024 11:50:26 +0000 (11:50 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 27 Jan 2024 11:54:12 +0000 (11:54 +0000)
I put that keypath in the file title, so I shouldn't have forgotten to
make it actually work!

src/file.rs

index 887a66badcc422e87299e0d2e1635abb6bab028c..9fc7dadbe7a3d64343b21717c0c8f717df14d08b 100644 (file)
@@ -441,6 +441,7 @@ struct File<Type: FileType, Source: FileDataSource> {
     search_direction: Option<SearchDirection>,
     last_search: Option<Regex>,
     latest_read_index: Option<isize>,
+    our_account_id: String, // for reference when we don't have a Client
 }
 
 impl<Type: FileType, Source: FileDataSource> File<Type, Source> {
@@ -533,6 +534,7 @@ impl<Type: FileType, Source: FileDataSource> File<Type, Source> {
             search_direction: None,
             last_search: None,
             latest_read_index,
+            our_account_id: client.our_account_id(),
         }
     }
 
@@ -1270,7 +1272,13 @@ impl<Type: FileType, Source: FileDataSource> 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<Type: FileType, Source: FileDataSource> 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 {