diff --git a/src/display-buffer.coffee b/src/display-buffer.coffee index 9dd844189..16c964908 100644 --- a/src/display-buffer.coffee +++ b/src/display-buffer.coffee @@ -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) => diff --git a/src/text-editor-component.coffee b/src/text-editor-component.coffee index 442f42a7e..925e6fa63 100644 --- a/src/text-editor-component.coffee +++ b/src/text-editor-component.coffee @@ -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 diff --git a/src/text-editor.coffee b/src/text-editor.coffee index acfa46d95..abed65842 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -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)