mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-14 04:29:04 +03:00
Implement getEmptyMessage() in CorrectionsView
This commit is contained in:
parent
1bc4b4ef32
commit
75cfddebcd
@ -39,15 +39,18 @@ class CorrectionsView extends SelectList
|
||||
|
||||
attach: ->
|
||||
@aboveCursor = false
|
||||
if @corrections.length > 0
|
||||
@setArray(@corrections)
|
||||
else
|
||||
@setError("No corrections found")
|
||||
@setArray(@corrections)
|
||||
|
||||
@editor.appendToLinesView(this)
|
||||
@setPosition()
|
||||
@miniEditor.focus()
|
||||
|
||||
getEmptyMessage: (itemCount) ->
|
||||
if itemCount is 0
|
||||
'No corrections'
|
||||
else
|
||||
super
|
||||
|
||||
detach: ->
|
||||
super
|
||||
|
||||
|
@ -97,7 +97,7 @@ describe "Spell check", ->
|
||||
editor.trigger 'editor:correct-misspelling'
|
||||
expect(editor.find('.corrections').length).toBe 1
|
||||
expect(editor.find('.corrections li').length).toBe 0
|
||||
expect(editor.find('.corrections .error').text()).toBe "No corrections found"
|
||||
expect(editor.find('.corrections').view().error.text()).toBe "No corrections"
|
||||
|
||||
describe "when the edit session is destroyed", ->
|
||||
it "destroys all misspelling markers", ->
|
||||
|
Loading…
Reference in New Issue
Block a user