mirror of
https://github.com/extrawurst/gitui.git
synced 2024-12-26 18:43:37 +03:00
do not highlight selection in diff when not focused (closes #270)
This commit is contained in:
parent
d179b6bb8b
commit
56959e6596
@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Added
|
||||
- push to origin support ([#265](https://github.com/extrawurst/gitui/issues/265))
|
||||
|
||||
### Changed
|
||||
- do not highlight selection in diff view when not focused ([#270](https://github.com/extrawurst/gitui/issues/270))
|
||||
|
||||
## [0.10.1] - 2020-09-01
|
||||
|
||||
### Fixed
|
||||
|
@ -349,8 +349,10 @@ impl DiffComponent {
|
||||
let mut lines_added = 0_usize;
|
||||
|
||||
for (i, hunk) in diff.hunks.iter().enumerate() {
|
||||
let hunk_selected =
|
||||
self.selected_hunk.map_or(false, |s| s == i);
|
||||
let hunk_selected = self.focused()
|
||||
&& self
|
||||
.selected_hunk
|
||||
.map_or(false, |s| s == i);
|
||||
|
||||
if lines_added >= height as usize {
|
||||
break;
|
||||
@ -372,8 +374,10 @@ impl DiffComponent {
|
||||
&mut res,
|
||||
width,
|
||||
line,
|
||||
self.selection
|
||||
.contains(line_cursor),
|
||||
self.focused()
|
||||
&& self
|
||||
.selection
|
||||
.contains(line_cursor),
|
||||
hunk_selected,
|
||||
i == hunk_len as usize - 1,
|
||||
&self.theme,
|
||||
|
Loading…
Reference in New Issue
Block a user