Merge master

This commit is contained in:
Garen Torikian
2013-04-10 15:05:21 -05:00
11 changed files with 178 additions and 6 deletions

View File

@@ -177,6 +177,7 @@ class Editor extends View
'editor:toggle-indent-guide': => config.set('editor.showIndentGuide', !config.get('editor.showIndentGuide'))
'editor:save-debug-snapshot': @saveDebugSnapshot
'editor:toggle-line-numbers': => config.set('editor.showLineNumbers', !config.get('editor.showLineNumbers'))
'editor:scroll-to-cursor': @scrollToCursorPosition
documentation = {}
for name, method of editorBindings
@@ -768,6 +769,9 @@ class Editor extends View
scrollToBottom: ->
@scrollBottom(@screenLineCount() * @lineHeight)
scrollToCursorPosition: ->
@scrollToBufferPosition(@getCursorBufferPosition(), center: true)
# Public: Scrolls the editor to the given buffer position.
#
# bufferPosition - An object that represents a buffer position. It can be either

View File

@@ -60,7 +60,7 @@ class Git
# Public: Reread the index to update any values that have changed since the last time the index was read.
refreshIndex: -> @getRepo().refreshIndex()
# Public: Retrieves the path of the repository.
#
# Returns a {String}.
@@ -219,7 +219,7 @@ class Git
# path - The {String} path to check
#
# Returns a {Number} representing the status.
getDirectoryStatus: (directoryPath) ->
getDirectoryStatus: (directoryPath) ->
directoryPath = "#{directoryPath}/"
directoryStatus = 0
for path, status of @statuses
@@ -234,5 +234,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}")

View File

@@ -27,6 +27,7 @@
'ctrl-meta-down': 'editor:move-line-down'
'meta-D': 'editor:duplicate-line'
'ctrl-J': 'editor:join-line'
'meta-<': 'editor:scroll-to-cursor'
'.editor.mini':
'enter': 'core:confirm',