File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ use std::{
10
10
} ;
11
11
12
12
///
13
- #[ derive( Default , Hash , Clone ) ]
13
+ #[ derive( Default , Hash , Clone , PartialEq ) ]
14
14
pub struct DiffParams ( pub String , pub bool ) ;
15
15
16
16
struct Request < R , A > ( R , Option < A > ) ;
@@ -42,10 +42,10 @@ impl AsyncDiff {
42
42
}
43
43
44
44
///
45
- pub fn last ( & mut self ) -> Option < FileDiff > {
45
+ pub fn last ( & mut self ) -> Option < ( DiffParams , FileDiff ) > {
46
46
let last = self . last . lock ( ) . unwrap ( ) ;
47
47
if let Some ( res) = last. clone ( ) {
48
- Some ( res. result )
48
+ Some ( ( res. params , res . result ) )
49
49
} else {
50
50
None
51
51
}
Original file line number Diff line number Diff line change @@ -281,8 +281,10 @@ impl App {
281
281
if self . diff . current ( ) == ( path. clone ( ) , is_stage) {
282
282
// we are already showing a diff of the right file
283
283
// maybe the diff changed (outside file change)
284
- if let Some ( last) = self . git_diff . last ( ) {
285
- self . diff . update ( path, is_stage, last) ;
284
+ if let Some ( ( params, last) ) = self . git_diff . last ( ) {
285
+ if params == diff_params {
286
+ self . diff . update ( path, is_stage, last) ;
287
+ }
286
288
}
287
289
} else {
288
290
// we dont show the right diff right now, so we need to request
You can’t perform that action at this time.
0 commit comments