mirror of
https://github.com/atom/atom.git
synced 2026-02-16 01:25:13 -05:00
Merge branch 'master' into indent-soft-wrap
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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}.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user