Merge branch 'master' into indent-soft-wrap

This commit is contained in:
Antonio Scandurra
2015-02-24 08:30:36 +01:00
12 changed files with 51 additions and 26 deletions

View File

@@ -11,7 +11,7 @@ findGitDirectorySync = (directory) ->
# can return cached values rather than always returning new objects:
# getParent(), getFile(), getSubdirectory().
gitDir = directory.getSubdirectory('.git')
if gitDir.existsSync() and isValidGitDirectorySync gitDir
if gitDir.existsSync?() and isValidGitDirectorySync gitDir
gitDir
else if directory.isRoot()
return null

View File

@@ -15,7 +15,7 @@
# specific position in the buffer.
# * {Cursor::getScopeDescriptor} to get a cursor's descriptor based on position.
#
# See the [scopes and scope descriptor guide](https://atom.io/docs/v0.138.0/advanced/scopes-and-scope-descriptors)
# See the [scopes and scope descriptor guide](https://atom.io/docs/latest/advanced/scopes-and-scope-descriptors)
# for more information.
module.exports =
class ScopeDescriptor

View File

@@ -228,8 +228,8 @@ class TextEditorPresenter
row++
if @mouseWheelScreenRow?
preservedLine = @model.tokenizedLineForScreenRow(@mouseWheelScreenRow)
visibleLineIds[preservedLine.id] = true
if preservedLine = @model.tokenizedLineForScreenRow(@mouseWheelScreenRow)
visibleLineIds[preservedLine.id] = true
for id, line of @state.content.lines
unless visibleLineIds.hasOwnProperty(id)

View File

@@ -1,5 +1,4 @@
{View, $} = require 'space-pen'
React = require 'react-atom-fork'
{defaults} = require 'underscore-plus'
TextBuffer = require 'text-buffer'
TextEditor = require './text-editor'
@@ -186,9 +185,6 @@ class TextEditorView extends View
view.css('z-index', 1)
@overlayer.append(view)
unmountComponent: ->
React.unmountComponentAtNode(@element) if @component.isMounted()
splitLeft: ->
deprecate """
Use Pane::splitLeft instead.

View File

@@ -2207,18 +2207,18 @@ class TextEditor extends Model
@suppressSelectionMerging = false
reducer = (disjointSelections, selection) ->
intersectingSelection = _.find disjointSelections, (otherSelection) ->
exclusive = not selection.isEmpty() and not otherSelection.isEmpty()
intersects = otherSelection.intersectsWith(selection, exclusive)
intersects
adjacentSelection = _.last(disjointSelections)
exclusive = not selection.isEmpty() and not adjacentSelection.isEmpty()
intersects = adjacentSelection.intersectsWith(selection, exclusive)
if intersectingSelection?
intersectingSelection.merge(selection, options)
if intersects
adjacentSelection.merge(selection, options)
disjointSelections
else
disjointSelections.concat([selection])
_.reduce(@getSelections(), reducer, [])
[head, tail...] = @getSelectionsOrderedByBufferPosition()
_.reduce(tail, reducer, [head])
# Add a {Selection} based on the given {Marker}.
#