You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Using regular expression can lead to editor freezing #174
When trying to find something like [\s*.]test[\s.] via regular expressions, the editor freezes while typing. Specifically, it freezes after I close the first set of square brackets. I'm assuming that this is because there are so many different combinations that match the regular expression that it is having trouble enumerating them all.
I'm not sure if this should really be filed under a bug, as it was obviously my fault for forming a regular expression with so many possible matches, but maybe there should be a catch for when the search is taking too long.
It's fine to file this as a bug. The goal is to be responsive regardless of how you use it. We're improving how Atom renders everything related to the editor, including the find-and-replace markers. Then we'll do an optimization pass on find-and-replace.
Voting this up.
I use regex-matching quite often and if I need to search for [AZ]foobar I usually type .foobar instead. This feezes the editor. COuld the auto matching have longer delay or require few more characters before activation as this would improve the usability of the search.
Or alternatively if the regex matches thousands of items in the file it could match just first ones and yield (dunno how this is applicable in your internal architecture)
I've found this too, on several occasions. Came here to raise a bug, but seeing as there is one already open, I will comment instead. The freezing is merely annoying, unless the editor has unsaved changes in which case, changes are permanently lost, and that can be a huge problem. Most recently I found this with the regex [^=].
The problem seems to be with automatically highlighting text. I'd suggest making automatic highlight an option — I wouldn't mind having to click "Go" to perform the search.
Activity
nathansobo commentedon Mar 31, 2014
It's fine to file this as a bug. The goal is to be responsive regardless of how you use it. We're improving how Atom renders everything related to the editor, including the find-and-replace markers. Then we'll do an optimization pass on find-and-replace.
BrunoGrandePhD commentedon Apr 21, 2014
I have a similar or identical issue when I simply type "()" in the search box with "Use Regex" option enabled. The app becomes unresponsive.
DepthDeluxe commentedon Jun 30, 2014
Issue is still here a couple of months later. Could auto regex matching be disabled for extremely simple phrases like
.or.*so atom doesn't freeze?nathansobo commentedon Jun 30, 2014
@benogle what do you think?
mtaponen commentedon Sep 30, 2014
Voting this up.
I use regex-matching quite often and if I need to search for [AZ]foobar I usually type .foobar instead. This feezes the editor. COuld the auto matching have longer delay or require few more characters before activation as this would improve the usability of the search.
Or alternatively if the regex matches thousands of items in the file it could match just first ones and yield (dunno how this is applicable in your internal architecture)
beingmrkenny commentedon Apr 16, 2015
I've found this too, on several occasions. Came here to raise a bug, but seeing as there is one already open, I will comment instead. The freezing is merely annoying, unless the editor has unsaved changes in which case, changes are permanently lost, and that can be a huge problem. Most recently I found this with the regex [^=].
The problem seems to be with automatically highlighting text. I'd suggest making automatic highlight an option — I wouldn't mind having to click "Go" to perform the search.
stimon commentedon Jul 20, 2015
This issue is happening to me all the time as well. Very annoying, since I use regex replace a lot.
Hope find a solution soon.