File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
### Added
11
11
- push to origin support ([ #265 ] ( https://github.com/extrawurst/gitui/issues/265 ) )
12
12
13
+ ### Changed
14
+ - do not highlight selection in diff view when not focused ([ #270 ] ( https://github.com/extrawurst/gitui/issues/270 ) )
15
+
13
16
## [ 0.10.1] - 2020-09-01
14
17
15
18
### Fixed
Original file line number Diff line number Diff line change @@ -349,8 +349,10 @@ impl DiffComponent {
349
349
let mut lines_added = 0_usize ;
350
350
351
351
for ( i, hunk) in diff. hunks . iter ( ) . enumerate ( ) {
352
- let hunk_selected =
353
- self . selected_hunk . map_or ( false , |s| s == i) ;
352
+ let hunk_selected = self . focused ( )
353
+ && self
354
+ . selected_hunk
355
+ . map_or ( false , |s| s == i) ;
354
356
355
357
if lines_added >= height as usize {
356
358
break ;
@@ -372,8 +374,10 @@ impl DiffComponent {
372
374
& mut res,
373
375
width,
374
376
line,
375
- self . selection
376
- . contains ( line_cursor) ,
377
+ self . focused ( )
378
+ && self
379
+ . selection
380
+ . contains ( line_cursor) ,
377
381
hunk_selected,
378
382
i == hunk_len as usize - 1 ,
379
383
& self . theme ,
You can’t perform that action at this time.
0 commit comments