This repository was archived by the owner on Dec 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ export default class FilePatchView {
5252 const selectedLines = this . selection . getSelectedLines ( )
5353 const headHunk = this . selection . getHeadHunk ( )
5454 const headLine = this . selection . getHeadLine ( )
55+ const hunkSelectionMode = this . selection . getMode ( ) === 'hunk'
5556 const stageButtonLabelPrefix = this . props . stagingStatus === 'unstaged' ? 'Stage' : 'Unstage'
5657 return (
5758 < div className = 'git-FilePatchView' tabIndex = '-1'
@@ -60,12 +61,13 @@ export default class FilePatchView {
6061 const isSelected = selectedHunks . has ( hunk )
6162 const stageButtonLabel =
6263 stageButtonLabelPrefix +
63- ( ( this . selection . getMode ( ) === 'hunk' || ! isSelected ) ? ' Hunk' : ' Selection' )
64+ ( ( hunkSelectionMode || ! isSelected ) ? ' Hunk' : ' Selection' )
6465
6566 return (
6667 < HunkView
6768 hunk = { hunk }
6869 isSelected = { selectedHunks . has ( hunk ) }
70+ hunkSelectionMode = { hunkSelectionMode }
6971 stageButtonLabel = { stageButtonLabel }
7072 selectedLines = { selectedLines }
7173 headLine = { headLine }
Original file line number Diff line number Diff line change @@ -38,8 +38,9 @@ export default class HunkView {
3838
3939 render ( ) {
4040 const hunkSelectedClass = this . props . isSelected ? 'is-selected' : ''
41+ const hunkModeClass = this . props . hunkSelectionMode ? 'is-hunkMode' : ''
4142 return (
42- < div className = { `git-HunkView ${ hunkSelectedClass } ` } >
43+ < div className = { `git-HunkView ${ hunkModeClass } ${ hunkSelectedClass } ` } >
4344 < div className = 'git-HunkView-header'
4445 onmousedown = { ( ) => this . props . mousedownOnHeader ( ) } >
4546 < span ref = 'header' className = 'git-HunkView-title' > { this . props . hunk . getHeader ( ) } </ span >
Original file line number Diff line number Diff line change 6868// States
6969// -------------------------------
7070
71+ // Highlight hunk title
72+ .git-HunkView {
73+ & .is-selected.is-hunkMode &-title {
74+ color : @text-color-selected ;
75+ }
76+ &-title :hover {
77+ color : @text-color-highlight ;
78+ }
79+ }
80+
7181.git-HunkView-line {
7282
7383 & .is-selected .git-HunkView-lineNumber {
You can’t perform that action at this time.
0 commit comments