-
Notifications
You must be signed in to change notification settings - Fork 29
Does not handle searching for multiline regex's #5
Comments
This would be a really useful feature, Is the PathSearcher object interchangable? |
Yeah, it can be. We can subclass it or something. Really, the thing that needs to change is the way we read the file. Was thinking of checking the regex for multiline search and then running a different codepath that handles multiline. |
+1 for different handlers, as not being able to search for |
+1 for different handlers as well |
+1 |
2 similar comments
+1 |
+1 |
Multiline search/replace is a crucial feature for me – as well as for many other devs, I guess. I’m on the verge of switching from Sublime to Atom – and this is the biggest thing holding me back. |
👍 |
1 similar comment
+1 |
+1, really missing useful feature i need a lot. makes me go back to dreamweaver just for doing multiline search and replace. i wont mind if it takes little bit more time to find. |
+1 |
1 similar comment
+1 |
+1 |
+1 would be willing to manually put in the |
+1 |
+1 if i was able to do multi-line regex search in Atom... |
What if we were to keep the current behavior for single-line searches (because it's fast), and only do something slower if we see a |
I'm working on this. There's some preliminary stuff at https://github.com/marnen/scandal/tree/5-multiline-find-and-replace. |
@marnen What's the status on this? |
@CharlotteDunois I never got very far, largely because I had higher priorities at the time. You're welcome to look at the branch I created and see if anything is useful; I'll take another look at it as well if I have time. |
I'm having a similar issue. I can multi line search in a file with regex no problem but when I try to search the folder/project no results are found. Find
Replace
Example to be replaced
|
The devs are well aware at this point. It's just not an easy fix so they haven't gotten to it yet. |
I'm not an Atom dev here, so take everything here with a grain of salt. To add on to what @garrettw said, if you look in the relevant source file itself, you'll find that it reads everything in chunks. JS regexps provide no way to suspend and resume matching, so you'd have to rewrite the regexp dynamically and reparse the result to do it. This, however, is a very non-trivial thing to do, and you really need engine support (and most non-streaming regexp engines don't provide this facility). |
PathSearcher
runs the regex on each line, not on the text as a whole. So something like[a-z]+\n[0-9]+
will not be matched.This was a design decision for efficiency. We only need to have each line, not the whole file. Right now the file reader only reads 10k at a time, and searches on the lines returned.
I'm not sure how to handle multiline regexs efficiently. How to make it handle a 100MB file? I'm opening this for discussion. As I build out the
PathReplacer
, it will have the same limitation.One approach could be to:
But on files with no match, it will read the entire file into memory.
The text was updated successfully, but these errors were encountered: