mirror of
https://github.com/atom/atom.git
synced 2026-02-09 14:15:24 -05:00
Merge branch 'master' of https://github.com/github/atom
This commit is contained in:
@@ -497,7 +497,13 @@ class Editor extends View
|
||||
scrollToBottom: ->
|
||||
@scrollBottom(@screenLineCount() * @lineHeight)
|
||||
|
||||
scrollTo: (pixelPosition, options) ->
|
||||
scrollToBufferPosition: (bufferPosition, options) ->
|
||||
@scrollToPixelPosition(@pixelPositionForBufferPosition(bufferPosition), options)
|
||||
|
||||
scrollToScreenPosition: (screenPosition, options) ->
|
||||
@scrollToPixelPosition(@pixelPositionForScreenPosition(screenPosition), options)
|
||||
|
||||
scrollToPixelPosition: (pixelPosition, options) ->
|
||||
return unless @attached
|
||||
@scrollVertically(pixelPosition, options)
|
||||
@scrollHorizontally(pixelPosition)
|
||||
@@ -800,11 +806,11 @@ class Editor extends View
|
||||
|
||||
autoscroll: (options={}) ->
|
||||
for cursorView in @getCursorViews() when cursorView.needsAutoscroll()
|
||||
@scrollTo(cursorView.getPixelPosition()) unless options.suppressAutoScroll
|
||||
@scrollToPixelPosition(cursorView.getPixelPosition()) unless options.suppressAutoScroll
|
||||
cursorView.autoscrolled()
|
||||
|
||||
for selectionView in @getSelectionViews() when selectionView.needsAutoscroll()
|
||||
@scrollTo(selectionView.getCenterPixelPosition(), center: true)
|
||||
@scrollToPixelPosition(selectionView.getCenterPixelPosition(), center: true)
|
||||
selectionView.autoscrolled()
|
||||
|
||||
updateRenderedLines: ->
|
||||
@@ -1025,6 +1031,9 @@ class Editor extends View
|
||||
@renderedLines.find('.line').each (n) ->
|
||||
console.log n, $(this).text()
|
||||
|
||||
pixelPositionForBufferPosition: (position) ->
|
||||
@pixelPositionForScreenPosition(@screenPositionForBufferPosition(position))
|
||||
|
||||
pixelPositionForScreenPosition: (position) ->
|
||||
position = Point.fromObject(position)
|
||||
{ top: position.row * @lineHeight, left: position.column * @charWidth }
|
||||
|
||||
@@ -19,7 +19,7 @@ class Git
|
||||
getPath: -> @repo.getPath()
|
||||
|
||||
getWorkingDirectory: ->
|
||||
repoPath = @repo.getPath()
|
||||
repoPath = @getPath()
|
||||
if repoPath
|
||||
repoPath.substring(0, repoPath.length - 5)
|
||||
|
||||
@@ -35,11 +35,16 @@ class Git
|
||||
isPathModified: (path) ->
|
||||
modifiedFlags = @statusFlags.working_dir_modified |
|
||||
@statusFlags.working_dir_delete |
|
||||
@statusFlags.working_dir_typechange
|
||||
@statusFlags.working_dir_typechange |
|
||||
@statusFlags.index_modified |
|
||||
@statusFlags.index_deleted |
|
||||
@statusFlags.index_typechange
|
||||
(@getPathStatus(path) & modifiedFlags) > 0
|
||||
|
||||
isPathNew: (path) ->
|
||||
(@getPathStatus(path) & @statusFlags.working_dir_new) > 0
|
||||
newFlags = @statusFlags.working_dir_new |
|
||||
@statusFlags.index_new
|
||||
(@getPathStatus(path) & newFlags) > 0
|
||||
|
||||
relativize: (path) ->
|
||||
workingDirectory = @getWorkingDirectory()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
_ = require 'underscore'
|
||||
{View, $$} = require 'space-pen'
|
||||
$ = require 'jquery'
|
||||
|
||||
module.exports =
|
||||
class StatusBar extends View
|
||||
@@ -36,6 +37,7 @@ class StatusBar extends View
|
||||
|
||||
@updateCursorPositionText()
|
||||
@editor.on 'cursor-move', => @updateCursorPositionText()
|
||||
$(window).on 'focus', => @updateStatusBar()
|
||||
|
||||
@subscribeToBuffer()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user