Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit f1aa436

Browse files
committed
Fix deceptive class when an error occurs
Consider the following scenario: 1. Turn on regex 2. Search for something simple in the file, eg "this" 3. has-results class appears as expected 4. Add an opening parenthesis to the find pattern 5. Find box is still green?!?! Step 5 introduces contradicting information: a red error message yet a green find box with the has-results class. So now when we set an error message we make sure to remove the has-results class and add the has-no-results class. I'm also fairly certain that nulling a function is not a good idea, so I removed that line.
1 parent 64b6a20 commit f1aa436

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/find-view.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ class FindView extends View
307307
atom.beep()
308308

309309
markersUpdated: (@markers) =>
310-
@findError = null
311310
@updateResultCounter()
312311
@updateReplaceEnablement()
313312

@@ -342,6 +341,8 @@ class FindView extends View
342341
@descriptionLabel.text(infoMessage).removeClass('text-error')
343342

344343
setErrorMessage: (errorMessage) ->
344+
this.removeClass('has-results')
345+
this.addClass('has-no-results')
345346
@descriptionLabel.text(errorMessage).addClass('text-error')
346347

347348
clearMessage: ->

0 commit comments

Comments
 (0)