mirror of
https://github.com/atom/atom.git
synced 2026-02-09 14:15:24 -05:00
Move .toggleLineComments method from TokenizedBuffer to TextEditor
This commit is contained in:
@@ -9,6 +9,8 @@ TokenizedBuffer = require './tokenized-buffer'
|
||||
Cursor = require './cursor'
|
||||
Model = require './model'
|
||||
Selection = require './selection'
|
||||
TextEditorUtils = require './text-editor-utils'
|
||||
|
||||
TextMateScopeSelector = require('first-mate').ScopeSelector
|
||||
GutterContainer = require './gutter-container'
|
||||
TextEditorComponent = null
|
||||
@@ -123,6 +125,8 @@ class TextEditor extends Model
|
||||
|
||||
Object.defineProperty(@prototype, 'languageMode', get: -> @tokenizedBuffer)
|
||||
|
||||
Object.assign(@prototype, TextEditorUtils)
|
||||
|
||||
@deserialize: (state, atomEnvironment) ->
|
||||
# TODO: Return null on version mismatch when 1.8.0 has been out for a while
|
||||
if state.version isnt @prototype.serializationVersion and state.displayBuffer?
|
||||
@@ -3621,9 +3625,6 @@ class TextEditor extends Model
|
||||
getNonWordCharacters: (scopes) ->
|
||||
@scopedSettingsDelegate?.getNonWordCharacters?(scopes) ? @nonWordCharacters
|
||||
|
||||
getCommentStrings: (scopes) ->
|
||||
@scopedSettingsDelegate?.getCommentStrings?(scopes)
|
||||
|
||||
###
|
||||
Section: Event Handlers
|
||||
###
|
||||
@@ -3886,8 +3887,6 @@ class TextEditor extends Model
|
||||
|
||||
toggleLineCommentForBufferRow: (row) -> @toggleLineCommentsForBufferRows(row, row)
|
||||
|
||||
toggleLineCommentsForBufferRows: (start, end) -> @tokenizedBuffer.toggleLineCommentsForBufferRows(start, end)
|
||||
|
||||
rowRangeForParagraphAtBufferRow: (bufferRow) ->
|
||||
return unless NON_WHITESPACE_REGEXP.test(@lineTextForBufferRow(bufferRow))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user