mirror of
https://github.com/atom/atom.git
synced 2026-02-15 09:05:58 -05:00
Rename node-nsspellchecker to node-spellchecker.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{View} = require 'space-pen'
|
||||
Range = require 'range'
|
||||
CorrectionsView = require './corrections-view'
|
||||
NSSpellChecker = require 'nsspellchecker'
|
||||
SpellChecker = require 'spellchecker'
|
||||
|
||||
module.exports =
|
||||
class MisspellingView extends View
|
||||
@@ -31,7 +31,7 @@ class MisspellingView extends View
|
||||
|
||||
screenRange = @getScreenRange()
|
||||
misspelling = @editor.getTextInRange(@editor.bufferRangeForScreenRange(screenRange))
|
||||
corrections = NSSpellChecker.getCorrectionsForMisspelling(misspelling)
|
||||
corrections = SpellChecker.getCorrectionsForMisspelling(misspelling)
|
||||
@correctionsView?.remove()
|
||||
@correctionsView = new CorrectionsView(@editor, corrections, screenRange)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
NSSpellChecker = require 'nsspellchecker'
|
||||
SpellChecker = require 'spellchecker'
|
||||
|
||||
module.exports =
|
||||
findMisspellings: (text) ->
|
||||
@@ -8,7 +8,7 @@ module.exports =
|
||||
for line in text.split('\n')
|
||||
while matches = wordRegex.exec(line)
|
||||
word = matches[1]
|
||||
continue unless NSSpellChecker.isMisspelled(word)
|
||||
continue unless SpellChecker.isMisspelled(word)
|
||||
startColumn = matches.index + matches[0].length - word.length
|
||||
endColumn = startColumn + word.length
|
||||
misspellings.push([[row, startColumn], [row, endColumn]])
|
||||
|
||||
Reference in New Issue
Block a user