@@ -16,16 +16,18 @@ class MinimapGitDiffBinding
1616
1717 @editor = @minimap .getTextEditor ()
1818
19- @subscriptions .add @editor .getBuffer ().onDidStopChanging @updateDiffs
2019 @subscriptions .add @minimap .onDidDestroy @destroy
2120
2221 if repository = @ getRepo ()
22+ @subscriptions .add @editor .getBuffer ().onDidStopChanging @updateDiffs
2323 @subscriptions .add repository .onDidChangeStatuses =>
2424 @ scheduleUpdate ()
2525 @subscriptions .add repository .onDidChangeStatus (changedPath) =>
2626 @ scheduleUpdate () if changedPath is @editor .getPath ()
2727 @subscriptions .add repository .onDidDestroy =>
2828 @ destroy ()
29+ @subscriptions .add atom .config .observe ' minimap-git-diff.useGutterDecoration' , (@useGutterDecoration ) =>
30+ @ scheduleUpdate ()
2931
3032 @ scheduleUpdate ()
3133
@@ -46,11 +48,11 @@ class MinimapGitDiffBinding
4648 startRow = newStart - 1
4749 endRow = newStart + newLines - 2
4850 if oldLines is 0 and newLines > 0
49- @ markRange (startRow, endRow, ' .minimap . git-line-added' )
51+ @ markRange (startRow, endRow, ' .git-line-added' )
5052 else if newLines is 0 and oldLines > 0
51- @ markRange (startRow, startRow, ' .minimap . git-line-removed' )
53+ @ markRange (startRow, startRow, ' .git-line-removed' )
5254 else
53- @ markRange (startRow, endRow, ' .minimap . git-line-modified' )
55+ @ markRange (startRow, endRow, ' .git-line-modified' )
5456
5557 removeDecorations : ->
5658 return unless @markers ?
@@ -60,7 +62,8 @@ class MinimapGitDiffBinding
6062 markRange : (startRow , endRow , scope ) ->
6163 return if @editor .displayBuffer .isDestroyed ()
6264 marker = @editor .markBufferRange ([[startRow, 0 ], [endRow, Infinity ]], invalidate : ' never' )
63- @minimap .decorateMarker (marker, type : ' line' , scope : scope, plugin : ' git-diff' )
65+ type = if @useGutterDecoration then ' gutter' else ' line'
66+ @minimap .decorateMarker (marker, {type, scope : " .minimap .#{ type} #{ scope} " , plugin : ' git-diff' })
6467 @markers ?= []
6568 @markers .push (marker)
6669
0 commit comments