Don't require SpellChecker module until correction command is triggered

This commit is contained in:
Kevin Sawicki
2013-04-25 09:33:11 -07:00
parent 59c02c90da
commit 00cb0bb8d9

View File

@@ -1,7 +1,6 @@
{View} = require 'space-pen'
Range = require 'range'
CorrectionsView = require './corrections-view'
SpellChecker = require 'spellchecker'
module.exports =
class MisspellingView extends View
@@ -31,6 +30,7 @@ class MisspellingView extends View
screenRange = @getScreenRange()
misspelling = @editor.getTextInRange(@editor.bufferRangeForScreenRange(screenRange))
SpellChecker = require 'spellchecker'
corrections = SpellChecker.getCorrectionsForMisspelling(misspelling)
@correctionsView?.remove()
@correctionsView = new CorrectionsView(@editor, corrections, screenRange)