mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Fix TextEditor tests
This commit is contained in:
@@ -6613,17 +6613,6 @@ describe('TextEditor', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('when the editor is constructed with the grammar option set', () => {
|
||||
beforeEach(async () => {
|
||||
await atom.packages.activatePackage('language-coffee-script')
|
||||
})
|
||||
|
||||
it('sets the grammar', () => {
|
||||
editor = new TextEditor({grammar: atom.grammars.grammarForScopeName('source.coffee')})
|
||||
expect(editor.getGrammar().name).toBe('CoffeeScript')
|
||||
})
|
||||
})
|
||||
|
||||
describe('softWrapAtPreferredLineLength', () => {
|
||||
it('soft wraps the editor at the preferred line length unless the editor is narrower or the editor is mini', () => {
|
||||
editor.update({
|
||||
|
||||
@@ -4437,10 +4437,10 @@ class TextEditor {
|
||||
toggleLineCommentForBufferRow (row) { this.toggleLineCommentsForBufferRows(row, row) }
|
||||
|
||||
toggleLineCommentsForBufferRows (start, end) {
|
||||
let {
|
||||
commentStartString,
|
||||
commentEndString
|
||||
} = this.buffer.getLanguageMode().commentStringsForPosition(Point(start, 0))
|
||||
const languageMode = this.buffer.getLanguageMode()
|
||||
let {commentStartString, commentEndString} =
|
||||
languageMode.commentStringsForPosition &&
|
||||
languageMode.commentStringsForPosition(Point(start, 0)) || {}
|
||||
if (!commentStartString) return
|
||||
commentStartString = commentStartString.trim()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user