adobe / brackets

An open source code editor for the web, written in JavaScript, HTML and CSS.
http://brackets.io
MIT License
33.25k stars 7.63k forks source link

Searching for invalid regular expression requires refresh to recover #9921

Open davemevans opened 9 years ago

davemevans commented 9 years ago

When pressing enter to search, if an invalid regular expression has been entered, the cursor constantly spins, as do the brackets in the status bar. Only reloading the application recovers.

The application knows the search term is invalid (displays a pink banner) so should not allow it to be searched.

peterflynn commented 9 years ago

I can confirm. Looks like FindInFiles._doSearch() returns null, which causes FindInFilesUI.searchAndShowResults() to crash since it always expects to get a promise back. (Maybe it should just return a rejected promise?). I'm guessing this has been broken ever since 0.41.

Workaround - run Find in Files again, with a valid search query (despite the spinning cursor, you can still click and type to interact with the Brackets UI).