Merge remote-tracking branch 'origin/master' into config

This commit is contained in:
Corey Johnson
2012-12-27 10:38:24 -08:00
34 changed files with 476 additions and 150 deletions

View File

@@ -10,7 +10,7 @@ class Directory
constructor: (@path) ->
getBaseName: ->
fs.base(@path) + '/'
fs.base(@path)
getPath: -> @path

View File

@@ -326,6 +326,14 @@ class Editor extends View
@removeClass 'focused'
@autosave() if config.get "editor.autosave"
@underlayer.on 'click', (e) =>
return unless e.target is @underlayer[0]
return unless e.offsetY > @overlayer.height()
if e.shiftKey
@selectToBottom()
else
@moveCursorToBottom()
@overlayer.on 'mousedown', (e) =>
@overlayer.hide()
clickedElement = document.elementFromPoint(e.pageX, e.pageY)
@@ -738,7 +746,7 @@ class Editor extends View
height = @lineHeight * @screenLineCount()
unless @layerHeight == height
@renderedLines.height(height)
@underlayer.height(height)
@underlayer.css('min-height', height)
@overlayer.height(height)
@layerHeight = height
@@ -751,6 +759,7 @@ class Editor extends View
@underlayer.css('min-width', minWidth)
@overlayer.css('min-width', minWidth)
@layerMinWidth = minWidth
@trigger 'editor:min-width-changed'
clearRenderedLines: ->
@renderedLines.empty()

View File

@@ -11,6 +11,11 @@ class Range
else
new Range(object.start, object.end)
@fromPointWithDelta: (point, rowDelta, columnDelta) ->
pointA = Point.fromObject(point)
pointB = new Point(point.row + rowDelta, point.column + columnDelta)
new Range(pointA, pointB)
constructor: (pointA = new Point(0, 0), pointB = new Point(0, 0)) ->
pointA = Point.fromObject(pointA)
pointB = Point.fromObject(pointB)

View File

@@ -42,11 +42,11 @@ class TextMateBundle
@grammarByShebang: (filePath) ->
try
firstLine = fs.read(filePath).match(/.*/)[0]
fileContents = fs.read(filePath)
catch e
null
_.find @grammars, (grammar) -> grammar.firstLineRegex?.test(firstLine)
_.find @grammars, (grammar) -> grammar.firstLineRegex?.test(fileContents)
@grammarForScopeName: (scopeName) ->
@grammarsByScopeName[scopeName]

View File

@@ -53,6 +53,7 @@ class TextMateGrammar
tokens.push(nextTokens...)
position = tokensEndPosition
break if position is line.length and nextTokens.length is 0
else # push filler token for unmatched text at end of line
if position < line.length