Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
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

Closed

Description

@rapidsnow

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.

Activity

  1. nathansobo commented on Mar 31, 2014

    @nathansobo
    Contributor

    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.

  2. BrunoGrandePhD commented on Apr 21, 2014

    @BrunoGrandePhD

    I have a similar or identical issue when I simply type "()" in the search box with "Use Regex" option enabled. The app becomes unresponsive.

  3. DepthDeluxe commented on Jun 30, 2014

    @DepthDeluxe
    Contributor

    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?

  4. nathansobo commented on Jun 30, 2014

    @nathansobo
    Contributor

    @benogle what do you think?

  5. mtaponen commented on Sep 30, 2014

    @mtaponen

    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)

  6. beingmrkenny commented on Apr 16, 2015

    @beingmrkenny

    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.

  7. stimon commented on Jul 20, 2015

    @stimon

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions