mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Update spell check view to use new task
This commit is contained in:
committed by
probablycorey
parent
a1d6ae010e
commit
b42cc6f683
@@ -1,12 +1,12 @@
|
||||
Task = require 'task'
|
||||
|
||||
fdescribe "Task", ->
|
||||
describe "Task", ->
|
||||
describe "populating the window with fake properties", ->
|
||||
describe "when jQuery is loaded in a child process", ->
|
||||
it "doesn't log to the console", ->
|
||||
spyOn(console, 'log').andCallThrough()
|
||||
spyOn(console, 'error').andCallThrough()
|
||||
spyOn(console, 'warn').andCallThrough()
|
||||
spyOn(console, 'log')
|
||||
spyOn(console, 'error')
|
||||
spyOn(console, 'warn')
|
||||
|
||||
jqueryTask = new Task('fixtures/jquery-task-handler.coffee')
|
||||
jqueryLoaded = false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{View} = require 'space-pen'
|
||||
_ = require 'underscore'
|
||||
SpellCheckTask = require './spell-check-task'
|
||||
Task = require 'task'
|
||||
MisspellingView = require './misspelling-view'
|
||||
|
||||
module.exports =
|
||||
@@ -8,6 +8,7 @@ class SpellCheckView extends View
|
||||
@content: ->
|
||||
@div class: 'spell-check'
|
||||
|
||||
task: null
|
||||
views: []
|
||||
|
||||
initialize: (@editor) ->
|
||||
@@ -21,10 +22,10 @@ class SpellCheckView extends View
|
||||
|
||||
beforeRemove: ->
|
||||
@unsubscribeFromBuffer()
|
||||
@task?.terminate
|
||||
|
||||
unsubscribeFromBuffer: ->
|
||||
@destroyViews()
|
||||
@task?.abort()
|
||||
|
||||
if @buffer?
|
||||
@buffer.off 'contents-modified', @updateMisspellings
|
||||
@@ -54,6 +55,6 @@ class SpellCheckView extends View
|
||||
@append(view)
|
||||
|
||||
updateMisspellings: =>
|
||||
@task.start buffer.getText(), (misspellings) =>
|
||||
@task.start @buffer.getText(), (misspellings) =>
|
||||
@destroyViews()
|
||||
@addViews(misspellings)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
RootView = require 'root-view'
|
||||
|
||||
fdescribe "Spell check", ->
|
||||
describe "Spell check", ->
|
||||
[editor] = []
|
||||
|
||||
beforeEach ->
|
||||
|
||||
@@ -43,4 +43,4 @@ class Task
|
||||
|
||||
@off()
|
||||
|
||||
_.extend Task.prototype, EventEmitter
|
||||
_.extend Task.prototype, EventEmitter
|
||||
|
||||
Reference in New Issue
Block a user