@@ -16,16 +16,18 @@ class MinimapGitDiffBinding
16
16
17
17
@editor = @minimap .getTextEditor ()
18
18
19
- @subscriptions .add @editor .getBuffer ().onDidStopChanging @updateDiffs
20
19
@subscriptions .add @minimap .onDidDestroy @destroy
21
20
22
21
if repository = @ getRepo ()
22
+ @subscriptions .add @editor .getBuffer ().onDidStopChanging @updateDiffs
23
23
@subscriptions .add repository .onDidChangeStatuses =>
24
24
@ scheduleUpdate ()
25
25
@subscriptions .add repository .onDidChangeStatus (changedPath) =>
26
26
@ scheduleUpdate () if changedPath is @editor .getPath ()
27
27
@subscriptions .add repository .onDidDestroy =>
28
28
@ destroy ()
29
+ @subscriptions .add atom .config .observe ' minimap-git-diff.useGutterDecoration' , (@useGutterDecoration ) =>
30
+ @ scheduleUpdate ()
29
31
30
32
@ scheduleUpdate ()
31
33
@@ -46,11 +48,11 @@ class MinimapGitDiffBinding
46
48
startRow = newStart - 1
47
49
endRow = newStart + newLines - 2
48
50
if oldLines is 0 and newLines > 0
49
- @ markRange (startRow, endRow, ' .minimap . git-line-added' )
51
+ @ markRange (startRow, endRow, ' .git-line-added' )
50
52
else if newLines is 0 and oldLines > 0
51
- @ markRange (startRow, startRow, ' .minimap . git-line-removed' )
53
+ @ markRange (startRow, startRow, ' .git-line-removed' )
52
54
else
53
- @ markRange (startRow, endRow, ' .minimap . git-line-modified' )
55
+ @ markRange (startRow, endRow, ' .git-line-modified' )
54
56
55
57
removeDecorations : ->
56
58
return unless @markers ?
@@ -60,7 +62,8 @@ class MinimapGitDiffBinding
60
62
markRange : (startRow , endRow , scope ) ->
61
63
return if @editor .displayBuffer .isDestroyed ()
62
64
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' })
64
67
@markers ?= []
65
68
@markers .push (marker)
66
69
0 commit comments