mirror of
https://github.com/atom/atom.git
synced 2026-02-08 21:55:05 -05:00
Merge remote-tracking branch 'origin/master' into config
This commit is contained in:
@@ -10,7 +10,7 @@ class Directory
|
||||
constructor: (@path) ->
|
||||
|
||||
getBaseName: ->
|
||||
fs.base(@path) + '/'
|
||||
fs.base(@path)
|
||||
|
||||
getPath: -> @path
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user