Add removeWord so that learning word removes all highlights for given word
This commit is contained in:
+6
@@ -45,6 +45,12 @@ define [
|
||||
@highlights = @highlights.filter (hl) ->
|
||||
hl != highlight
|
||||
|
||||
removeWord: (word) ->
|
||||
@highlights.filter (highlight) ->
|
||||
highlight.word == word
|
||||
.forEach (highlight) =>
|
||||
@removeHighlight(highlight)
|
||||
|
||||
clearRow: (row) ->
|
||||
@highlights.filter (highlight) ->
|
||||
highlight.range.start.row == row
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ define [], () ->
|
||||
|
||||
learnWord: (highlight) =>
|
||||
@apiRequest "/learn", word: highlight.word
|
||||
@adapter.highlightedWordManager.removeHighlight highlight
|
||||
@adapter.highlightedWordManager.removeWord highlight.word
|
||||
language = @$scope.spellCheckLanguage
|
||||
@cache?.put("#{language}:#{highlight.word}", true)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user