Add line diff decorations to editor gutter

Added, modified, and deleted lines will now highlighted
in the gutter for files already checked in to the repository.
This commit is contained in:
Kevin Sawicki
2013-04-10 12:16:19 -07:00
parent b74f2a3e9e
commit f868c0cd4f
7 changed files with 154 additions and 2 deletions

View File

@@ -123,7 +123,7 @@ class Git
@statusTask = null
@statusTask.start()
getDirectoryStatus: (directoryPath) ->
getDirectoryStatus: (directoryPath) ->
directoryPath = "#{directoryPath}/"
directoryStatus = 0
for path, status of @statuses
@@ -133,5 +133,8 @@ class Git
getAheadBehindCounts: ->
@getRepo().getAheadBehindCount()
getLineDiffs: (path, text) ->
@getRepo().getLineDiffs(@relativize(path), text)
_.extend Git.prototype, Subscriber
_.extend Git.prototype, EventEmitter

View File

@@ -76,7 +76,7 @@ class Gutter extends View
rowValue = (row + 1).toString()
classes = ['line-number']
classes.push('fold') if editor.isFoldedAtBufferRow(row)
@div class: classes.join(' '), =>
@div lineNumber: row, class: classes.join(' '), =>
rowValuePadding = _.multiplyString(' ', maxDigits - rowValue.length)
@raw("#{rowValuePadding}#{rowValue}")