Merge branch 'master' into ns-switch-to-display-layers

# Conflicts:
#	src/text-editor.coffee
This commit is contained in:
Antonio Scandurra
2016-04-26 10:19:39 +02:00
14 changed files with 93 additions and 817 deletions

View File

@@ -108,7 +108,6 @@ class TextEditor extends Model
state.displayLayer = state.buffer.getDisplayLayer(state.displayLayerId) ? state.buffer.addDisplayLayer()
state.selectionsMarkerLayer = state.displayLayer.getMarkerLayer(state.selectionsMarkerLayerId)
state.config = atomEnvironment.config
state.notificationManager = atomEnvironment.notifications
state.packageManager = atomEnvironment.packages
state.clipboard = atomEnvironment.clipboard
state.viewRegistry = atomEnvironment.views
@@ -129,18 +128,12 @@ class TextEditor extends Model
@softTabs, @firstVisibleScreenRow, @firstVisibleScreenColumn, initialLine, initialColumn, @tabLength,
@softWrapped, @decorationManager, @selectionsMarkerLayer, @buffer, suppressCursorCreation,
@mini, @placeholderText, lineNumberGutterVisible, @largeFileMode, @config,
@notificationManager, @packageManager, @clipboard, @viewRegistry, @grammarRegistry,
@project, @assert, @applicationDelegate, grammar, @showInvisibles, @autoHeight, @scrollPastEnd
@packageManager, @clipboard, @viewRegistry, @grammarRegistry,
@project, @assert, @applicationDelegate, grammar, @showInvisibles, @autoHeight, @scrollPastEnd,
@editorWidthInChars, @tokenizedBuffer, @ignoreInvisibles, @displayLayer
} = params
{
tabLength, @editorWidthInChars, @tokenizedBuffer, buffer, @ignoreInvisibles,
@largeFileMode, @config, @assert, @grammarRegistry, @packageManager, @displayLayer
} = params
throw new Error("Must pass a config parameter when constructing TextEditors") unless @config?
throw new Error("Must pass a notificationManager parameter when constructing TextEditors") unless @notificationManager?
throw new Error("Must pass a packageManager parameter when constructing TextEditors") unless @packageManager?
throw new Error("Must pass a clipboard parameter when constructing TextEditors") unless @clipboard?
throw new Error("Must pass a viewRegistry parameter when constructing TextEditors") unless @viewRegistry?
@@ -163,7 +156,7 @@ class TextEditor extends Model
@buffer ?= new TextBuffer
@tokenizedBuffer ?= new TokenizedBuffer({
tabLength, @buffer, @largeFileMode, @config,
@tabLength, @buffer, @largeFileMode, @config,
@grammarRegistry, @packageManager, @assert
})
@displayLayer ?= @buffer.addDisplayLayer()
@@ -596,7 +589,7 @@ class TextEditor extends Model
softTabs = @getSoftTabs()
newEditor = new TextEditor({
@buffer, selectionsMarkerLayer, @tabLength, softTabs,
suppressCursorCreation: true, @config, @notificationManager, @packageManager,
suppressCursorCreation: true, @config, @packageManager,
@firstVisibleScreenRow, @firstVisibleScreenColumn,
@clipboard, @viewRegistry, @grammarRegistry, @project, @assert, @applicationDelegate,
displayLayer
@@ -3023,13 +3016,9 @@ class TextEditor extends Model
@commentScopeSelector ?= new TextMateScopeSelector('comment.*')
@commentScopeSelector.matches(@scopeDescriptorForBufferPosition([bufferRow, match.index]).scopes)
logCursorScope: ->
scopeDescriptor = @getLastCursor().getScopeDescriptor()
list = scopeDescriptor.scopes.toString().split(',')
list = list.map (item) -> "* #{item}"
content = "Scopes at Cursor\n#{list.join('\n')}"
@notificationManager.addInfo(content, dismissable: true)
# Get the scope descriptor at the cursor.
getCursorScope: ->
@getLastCursor().getScopeDescriptor()
tokenForBufferPosition: (bufferPosition) ->
@tokenizedBuffer.tokenForPosition(bufferPosition)