mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Don't require SpellChecker module until correction command is triggered
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user