mirror of
https://github.com/atom/atom.git
synced 2026-02-07 05:05:02 -05:00
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:
@@ -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
|
||||
|
||||
@@ -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}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user