@@ -8,15 +8,15 @@ use crate::{
88 ExternalEditorComponent , HelpComponent ,
99 InspectCommitComponent , MsgComponent , PullComponent ,
1010 PushComponent , PushTagsComponent , RenameBranchComponent ,
11- ResetComponent , RevisionFilesComponent , StashMsgComponent ,
11+ ResetComponent , RevisionFilesPopup , StashMsgComponent ,
1212 TagCommitComponent , TagListComponent ,
1313 } ,
1414 input:: { Input , InputEvent , InputState } ,
1515 keys:: { KeyConfig , SharedKeyConfig } ,
1616 queue:: { Action , InternalEvent , NeedsUpdate , Queue } ,
1717 setup_popups,
1818 strings:: { self , order} ,
19- tabs:: { Revlog , StashList , Stashing , Status } ,
19+ tabs:: { FilesTab , Revlog , StashList , Stashing , Status } ,
2020 ui:: style:: { SharedTheme , Theme } ,
2121} ;
2222use anyhow:: { bail, Result } ;
@@ -47,7 +47,7 @@ pub struct App {
4747 stashmsg_popup : StashMsgComponent ,
4848 inspect_commit_popup : InspectCommitComponent ,
4949 external_editor_popup : ExternalEditorComponent ,
50- revision_files_popup : RevisionFilesComponent ,
50+ revision_files_popup : RevisionFilesPopup ,
5151 push_popup : PushComponent ,
5252 push_tags_popup : PushTagsComponent ,
5353 pull_popup : PullComponent ,
@@ -62,6 +62,7 @@ pub struct App {
6262 status_tab : Status ,
6363 stashing_tab : Stashing ,
6464 stashlist_tab : StashList ,
65+ files_tab : FilesTab ,
6566 queue : Queue ,
6667 theme : SharedTheme ,
6768 key_config : SharedKeyConfig ,
@@ -105,7 +106,7 @@ impl App {
105106 theme. clone ( ) ,
106107 key_config. clone ( ) ,
107108 ) ,
108- revision_files_popup : RevisionFilesComponent :: new (
109+ revision_files_popup : RevisionFilesPopup :: new (
109110 & queue,
110111 sender,
111112 theme. clone ( ) ,
@@ -203,6 +204,12 @@ impl App {
203204 theme. clone ( ) ,
204205 key_config. clone ( ) ,
205206 ) ,
207+ files_tab : FilesTab :: new (
208+ sender,
209+ & queue,
210+ theme. clone ( ) ,
211+ key_config. clone ( ) ,
212+ ) ,
206213 queue,
207214 theme,
208215 key_config,
@@ -237,8 +244,9 @@ impl App {
237244 match self . tab {
238245 0 => self . status_tab . draw ( f, chunks_main[ 1 ] ) ?,
239246 1 => self . revlog . draw ( f, chunks_main[ 1 ] ) ?,
240- 2 => self . stashing_tab . draw ( f, chunks_main[ 1 ] ) ?,
241- 3 => self . stashlist_tab . draw ( f, chunks_main[ 1 ] ) ?,
247+ 2 => self . files_tab . draw ( f, chunks_main[ 1 ] ) ?,
248+ 3 => self . stashing_tab . draw ( f, chunks_main[ 1 ] ) ?,
249+ 4 => self . stashlist_tab . draw ( f, chunks_main[ 1 ] ) ?,
242250 _ => bail ! ( "unknown tab" ) ,
243251 } ;
244252
@@ -271,6 +279,7 @@ impl App {
271279 NeedsUpdate :: COMMANDS
272280 } else if k == self . key_config . tab_status
273281 || k == self . key_config . tab_log
282+ || k == self . key_config . tab_files
274283 || k == self . key_config . tab_stashing
275284 || k == self . key_config . tab_stashes
276285 {
@@ -322,6 +331,7 @@ impl App {
322331 self . commit . update ( ) ?;
323332 self . status_tab . update ( ) ?;
324333 self . revlog . update ( ) ?;
334+ self . files_tab . update ( ) ?;
325335 self . stashing_tab . update ( ) ?;
326336 self . stashlist_tab . update ( ) ?;
327337
@@ -339,6 +349,7 @@ impl App {
339349
340350 self . status_tab . update_git ( ev) ?;
341351 self . stashing_tab . update_git ( ev) ?;
352+ self . files_tab . update_git ( ev) ?;
342353 self . revlog . update_git ( ev) ?;
343354 self . blame_file_popup . update_git ( ev) ?;
344355 self . inspect_commit_popup . update_git ( ev) ?;
@@ -364,6 +375,7 @@ impl App {
364375 self . status_tab . anything_pending ( )
365376 || self . revlog . any_work_pending ( )
366377 || self . stashing_tab . anything_pending ( )
378+ || self . files_tab . anything_pending ( )
367379 || self . blame_file_popup . any_work_pending ( )
368380 || self . inspect_commit_popup . any_work_pending ( )
369381 || self . input . is_state_changing ( )
@@ -408,6 +420,7 @@ impl App {
408420 help,
409421 revlog,
410422 status_tab,
423+ files_tab,
411424 stashing_tab,
412425 stashlist_tab
413426 ]
@@ -450,6 +463,7 @@ impl App {
450463 vec ! [
451464 & mut self . status_tab,
452465 & mut self . revlog,
466+ & mut self . files_tab,
453467 & mut self . stashing_tab,
454468 & mut self . stashlist_tab,
455469 ]
@@ -471,10 +485,12 @@ impl App {
471485 self . set_tab ( 0 ) ?
472486 } else if k == self . key_config . tab_log {
473487 self . set_tab ( 1 ) ?
474- } else if k == self . key_config . tab_stashing {
488+ } else if k == self . key_config . tab_files {
475489 self . set_tab ( 2 ) ?
476- } else if k == self . key_config . tab_stashes {
490+ } else if k == self . key_config . tab_stashing {
477491 self . set_tab ( 3 ) ?
492+ } else if k == self . key_config . tab_stashes {
493+ self . set_tab ( 4 ) ?
478494 }
479495
480496 Ok ( ( ) )
@@ -748,6 +764,7 @@ impl App {
748764 let tabs = [
749765 Span :: raw ( strings:: tab_status ( & self . key_config ) ) ,
750766 Span :: raw ( strings:: tab_log ( & self . key_config ) ) ,
767+ Span :: raw ( strings:: tab_files ( & self . key_config ) ) ,
751768 Span :: raw ( strings:: tab_stashing ( & self . key_config ) ) ,
752769 Span :: raw ( strings:: tab_stashes ( & self . key_config ) ) ,
753770 ]
0 commit comments