This repository was archived by the owner on Dec 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -239,7 +239,7 @@ class BufferSearch {
239239 }
240240 }
241241
242- this . emitter . emit ( 'did-update' , this . markers . slice ( ) ) ;
242+ if ( changes . length ) this . emitter . emit ( 'did-update' , this . markers . slice ( ) ) ;
243243 this . currentResultMarker = null ;
244244 this . setCurrentMarkerFromSelection ( ) ;
245245 }
Original file line number Diff line number Diff line change @@ -506,6 +506,18 @@ describe 'FindView', ->
506506 expect (findView .descriptionLabel ).toHaveClass ' text-error'
507507 expect (findView .descriptionLabel .text ()).toContain ' Invalid regular expression'
508508
509+ it " does not reset when the buffer is updated" , ->
510+ # This is a rather specific test: the error message only disappeared
511+ # when there were no changes. Backspacing nothing can reproduce this,
512+ # as well as saving or undoing and then redoing.
513+ editor .setCursorBufferPosition ([0 , 0 ])
514+ # Since we're at the beginning of the file, backspacing will do nothing but still send a change event
515+ editor .backspace ()
516+ advanceClock (editor .buffer .stoppedChangingDelay )
517+
518+ expect (findView .descriptionLabel ).toHaveClass ' text-error'
519+ expect (findView .descriptionLabel .text ()).toContain ' Invalid regular expression'
520+
509521 it " will be reset when there is no longer an error" , ->
510522 expect (findView .descriptionLabel ).toHaveClass ' text-error'
511523
You can’t perform that action at this time.
0 commit comments