I am working in a Rails project, and one of the files in the project tree is a catalog of books, exported from another system as a 1MB single-line file. When I engage multi-file search, I will end up in spinning-pizza-of-death until I force-quit the app. As a work-around, I have had to keep search from looking inside it by declaring it to be one of the non-text files (right after jpeg) in the preferences in order to be able to search for anything at all across files.
Is there a better way that I can handle this? It's non-ideal to never be able to look in a JSON file within TM. I can use BBEdit, which does not have any issue at all opening this file, but I'd like to keep it all together.
How else could I globally keep multi-file search from trying to read this file?
Thanks,
Walter
If you don't already have one, try creating a ".tm_properties" file in your project directory Add the single line....
excludeInFolderSearch = "{$excludeInFolderSearch,*.json}"
On 5 June 2016 at 20:50, Walter Lee Davis waltd@wdstudio.com wrote:
I am working in a Rails project, and one of the files in the project tree is a catalog of books, exported from another system as a 1MB single-line file. When I engage multi-file search, I will end up in spinning-pizza-of-death until I force-quit the app. As a work-around, I have had to keep search from looking inside it by declaring it to be one of the non-text files (right after jpeg) in the preferences in order to be able to search for anything at all across files.
Is there a better way that I can handle this? It's non-ideal to never be able to look in a JSON file within TM. I can use BBEdit, which does not have any issue at all opening this file, but I'd like to keep it all together.
How else could I globally keep multi-file search from trying to read this file?
Thanks,
Walter
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Do I need to restart or re-open the project? Because it just beach balled again when I tried this (and removed it from the list of binary files).
Walter
On Jun 5, 2016, at 4:00 PM, Carpii UK carpii.uk@gmail.com wrote:
excludeInFolderSearch = "{$excludeInFolderSearch,*.json}"
Never mind, I didn't get it all the way into the root of the folder. This gives me some ideas about restricting search within logs, or the asset pipeline detritus.
Walter
On Jun 5, 2016, at 4:06 PM, Walter Lee Davis waltd@wdstudio.com wrote:
Do I need to restart or re-open the project? Because it just beach balled again when I tried this (and removed it from the list of binary files).
Walter
On Jun 5, 2016, at 4:00 PM, Carpii UK carpii.uk@gmail.com wrote:
excludeInFolderSearch = "{$excludeInFolderSearch,*.json}"
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 5 Jun 2016, at 22:09, Walter Lee Davis wrote:
Never mind, I didn't get it all the way into the root of the folder. This gives me some ideas about restricting search within logs, or the asset pipeline detritus.
For changing what to search (for a given project) I suggest editing the “matching” text field in the search window. You can prefix with ~ to exclude items and use ** to match everything below a certain folder.
For example to exclude all your log files use: ~logs/**
Hint: When you search a project and you get a match from a file that you want to exclude, simply hold ‘option’ and click the remove button for this match, then the path of that file will be added to the current “matching glob” (you can edit it afterward if you want to generalize it).
As for your 1MB JSON file, if I need to look into this, you need to provide the file and what you searched for.
I did a quick test by generating a 1 MB file and appended a special string, then searched for this string, and while there were delays, they were sub-second delays. I think they are mainly related to generating the 1 MB text string to show in the search window, which I could probably limit to +/- 500 bytes from where the match was found.
On Jun 5, 2016, at 4:19 PM, Allan Odgaard mailinglist@textmate.org wrote:
On 5 Jun 2016, at 22:09, Walter Lee Davis wrote:
Never mind, I didn't get it all the way into the root of the folder. This gives me some ideas about restricting search within logs, or the asset pipeline detritus.
For changing what to search (for a given project) I suggest editing the “matching” text field in the search window. You can prefix with ~ to exclude items and use ** to match everything below a certain folder.
For example to exclude all your log files use: ~logs/**
Hint: When you search a project and you get a match from a file that you want to exclude, simply hold ‘option’ and click the remove button for this match, then the path of that file will be added to the current “matching glob” (you can edit it afterward if you want to generalize it).
These are great tips, thanks!
As for your 1MB JSON file, if I need to look into this, you need to provide the file and what you searched for.
Sure, I can do that if you need me to.
I did a quick test by generating a 1 MB file and appended a special string, then searched for this string, and while there were delays, they were sub-second delays. I think they are mainly related to generating the 1 MB text string to show in the search window, which I could probably limit to +/- 500 bytes from where the match was found.
My search string was `title`, which occurs hundreds of times within the file (although I wasn't actually looking for it within that file).
Walter
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Are you able to open the file with TM normally?
On 5 Jun 2016, at 22:24, Walter Lee Davis wrote:
My search string was `title`, which occurs hundreds of times within the file (although I wasn't actually looking for it within that file).
OK, this would have given hundreds of one megabyte strings to show in the find dialog, so most likely this is what is causing the bad performance.
I’ll limit the context/excerpt shown for the match to address it.
On Jun 5, 2016, at 4:31 PM, Allan Odgaard mailinglist@textmate.org wrote:
I’ll limit the context/excerpt shown for the match to address it.
I think this may also solve a long-standing problem I have with the multi-file search. When a result occurs far to the right in a file, I often cannot see it at all, and sometimes cannot see it in the tooltip, either. If the results were more like ...context context context context match context context context..., so you could see if it had been truncated, then this could kill two birds with one stone.
Walter
On 5 Jun 2016, at 22:38, Walter Lee Davis wrote:
On Jun 5, 2016, at 4:31 PM, Allan Odgaard mailinglist@textmate.org wrote:
I’ll limit the context/excerpt shown for the match to address it.
I think this may also solve a long-standing problem I have with the multi-file search […]
Performance should be much better in latest nightly build and the context before a match is limited to 150 bytes, though it might be less as I try to match up the excerpts, e.g. a match at offset 337 and one at 394 will both have their context start from byte 300 so it is visually more clear that we are still on the same line (for the second match).
On 5 June 2016 at 21:06, Walter Lee Davis waltd@wdstudio.com wrote:
Do I need to restart or re-open the project? Because it just beach balled again when I tried this (and removed it from the list of binary files).
Not as far as I know. I find that changes to .tm_properties are usually detected as soon as you save it You may need to close and reopen the Find/Replace dialog though
Are you using TextMate 2?