mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
getGrammarScopeDescriptor -> getRootScopeDescriptor
This commit is contained in:
@@ -65,7 +65,7 @@ class DisplayBuffer extends Model
|
||||
@scopedConfigSubscriptions?.dispose()
|
||||
@scopedConfigSubscriptions = subscriptions = new CompositeDisposable
|
||||
|
||||
scopeDescriptor = @getGrammarScopeDescriptor()
|
||||
scopeDescriptor = @getRootScopeDescriptor()
|
||||
|
||||
subscriptions.add atom.config.onDidChange scopeDescriptor, 'editor.softWrap', =>
|
||||
@updateWrappedScreenLines()
|
||||
@@ -328,7 +328,7 @@ class DisplayBuffer extends Model
|
||||
return 0 unless lineHeight > 0
|
||||
|
||||
scrollHeight = @getLineCount() * lineHeight
|
||||
if @height? and atom.config.get(@getGrammarScopeDescriptor(), 'editor.scrollPastEnd')
|
||||
if @height? and atom.config.get(@getRootScopeDescriptor(), 'editor.scrollPastEnd')
|
||||
scrollHeight = scrollHeight + @height - (lineHeight * 3)
|
||||
|
||||
scrollHeight
|
||||
@@ -429,7 +429,7 @@ class DisplayBuffer extends Model
|
||||
@isSoftWrapped()
|
||||
|
||||
isSoftWrapped: ->
|
||||
@softWrapped ? atom.config.get(@getGrammarScopeDescriptor(), 'editor.softWrap') ? false
|
||||
@softWrapped ? atom.config.get(@getRootScopeDescriptor(), 'editor.softWrap') ? false
|
||||
|
||||
# Set the number of characters that fit horizontally in the editor.
|
||||
#
|
||||
@@ -451,8 +451,8 @@ class DisplayBuffer extends Model
|
||||
@editorWidthInChars
|
||||
|
||||
getSoftWrapColumn: ->
|
||||
if atom.config.get(@getGrammarScopeDescriptor(), 'editor.softWrapAtPreferredLineLength')
|
||||
Math.min(@getEditorWidthInChars(), atom.config.get(@getGrammarScopeDescriptor(), 'editor.preferredLineLength'))
|
||||
if atom.config.get(@getRootScopeDescriptor(), 'editor.softWrapAtPreferredLineLength')
|
||||
Math.min(@getEditorWidthInChars(), atom.config.get(@getRootScopeDescriptor(), 'editor.preferredLineLength'))
|
||||
else
|
||||
@getEditorWidthInChars()
|
||||
|
||||
@@ -1047,7 +1047,7 @@ class DisplayBuffer extends Model
|
||||
line = @tokenizedLineForScreenRow(row).text
|
||||
console.log row, @bufferRowForScreenRow(row), line, line.length
|
||||
|
||||
getGrammarScopeDescriptor: ->
|
||||
getRootScopeDescriptor: ->
|
||||
@tokenizedBuffer.grammarScopeDescriptor
|
||||
|
||||
handleTokenizedBufferChange: (tokenizedBufferChange) =>
|
||||
|
||||
@@ -416,7 +416,7 @@ TextEditorComponent = React.createClass
|
||||
@scopedConfigSubscriptions?.dispose()
|
||||
@scopedConfigSubscriptions = subscriptions = new CompositeDisposable
|
||||
|
||||
scopeDescriptor = editor.getGrammarScopeDescriptor()
|
||||
scopeDescriptor = editor.getRootScopeDescriptor()
|
||||
|
||||
subscriptions.add atom.config.observe scopeDescriptor, 'editor.showIndentGuide', @setShowIndentGuide
|
||||
subscriptions.add atom.config.observe scopeDescriptor, 'editor.showLineNumbers', @setShowLineNumbers
|
||||
|
||||
@@ -163,7 +163,7 @@ class TextEditor extends Model
|
||||
@scopedConfigSubscriptions?.dispose()
|
||||
@scopedConfigSubscriptions = subscriptions = new CompositeDisposable
|
||||
|
||||
scopeDescriptor = @getGrammarScopeDescriptor()
|
||||
scopeDescriptor = @getRootScopeDescriptor()
|
||||
|
||||
subscriptions.add atom.config.onDidChange scopeDescriptor, 'editor.showInvisibles', => @updateInvisibles()
|
||||
subscriptions.add atom.config.onDidChange scopeDescriptor, 'editor.invisibles', => @updateInvisibles()
|
||||
@@ -2369,7 +2369,7 @@ class TextEditor extends Model
|
||||
if cursor = @getLastCursor()
|
||||
cursor.getScopes()
|
||||
else
|
||||
@getGrammarScopeDescriptor()
|
||||
@getRootScopeDescriptor()
|
||||
getCursorScopes: ->
|
||||
deprecate 'Use TextEditor::scopesAtCursor() instead'
|
||||
@scopesAtCursor()
|
||||
@@ -2396,8 +2396,8 @@ class TextEditor extends Model
|
||||
bufferRangeForScopeAtCursor: (selector) ->
|
||||
@displayBuffer.bufferRangeForScopeAtPosition(selector, @getCursorBufferPosition())
|
||||
|
||||
getGrammarScopeDescriptor: ->
|
||||
@displayBuffer.getGrammarScopeDescriptor()
|
||||
getRootScopeDescriptor: ->
|
||||
@displayBuffer.getRootScopeDescriptor()
|
||||
|
||||
logCursorScope: ->
|
||||
console.log @scopesAtCursor()
|
||||
@@ -2668,14 +2668,14 @@ class TextEditor extends Model
|
||||
###
|
||||
|
||||
shouldAutoIndent: ->
|
||||
atom.config.get(@getGrammarScopeDescriptor(), "editor.autoIndent")
|
||||
atom.config.get(@getRootScopeDescriptor(), "editor.autoIndent")
|
||||
|
||||
shouldShowInvisibles: ->
|
||||
not @mini and atom.config.get(@getGrammarScopeDescriptor(), 'editor.showInvisibles')
|
||||
not @mini and atom.config.get(@getRootScopeDescriptor(), 'editor.showInvisibles')
|
||||
|
||||
updateInvisibles: ->
|
||||
if @shouldShowInvisibles()
|
||||
@displayBuffer.setInvisibles(atom.config.get(@getGrammarScopeDescriptor(), 'editor.invisibles'))
|
||||
@displayBuffer.setInvisibles(atom.config.get(@getRootScopeDescriptor(), 'editor.invisibles'))
|
||||
else
|
||||
@displayBuffer.setInvisibles(null)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user