Sublime Forum

Regex and Find in Files Weirdness

#1

Am trying to get regex to work in find in files. Having finally got it to work, instead of bringing up a new tab with a list of all the matches, it displays the matches in the same panel, ie the dialog box of the find in files function.
Interestingly if the regex doesn’t work the behaviour is as expected (ie new tab with “0 matches found …” etc)

Here as some screen shots:
Here I’m searching for small_texture and imagePs, (there’s a match in Mandelbrot_Resourcer.cpp, line 179)

As you can see the find results are at the bottom of the screen !

If I use regex, then all subsequent finds appear in the wrong dialog box. If I quit ST3, I still can’t use find in files. Am gonna turn on and off again, but obvs then won’t be able to continue writing this, so am gonna post now…

ATB :unicorn::skull_and_crossbones:

Ps “Find in Files is now broken”, even after turning my machine on and off, Find in Files now doesn’t bring up the search in a new tab anymore. SIGH.
I know newly installed state…

Pps Before newly installed state

(I want to avoid, as I’m trying to do some work and it’s extra work as I can’t quite remember how to do it off the top of my head)

there is some good news it’s only in that current project, in the other projects Find in Files works as expected, I wonder if I can hunt through the workspace file an find something…

0 Likes

#2

There’s a button in the Find in Files panel that controls wether or not the results of the find go into a panel or into a buffer:

image

Screenshot here is from ST4, but the button is in the same place in ST3 as well.

When it’s turned on, the results go to a tab, which will keep being re-used (though you could mistake it for generating a new tab because it scrolls the content to put the new search at the top of the window).

That operation is distinct from regex operations however; it’s also state that’s stored in a project by project manner, so the setting will change as you move from project to project if it’s different.

1 Like

#3

I’ve just spent an age looking through workspace files trying to find the differences etc etc etc.

MASSIVE FACE PALM !!

Thank you very much for coming once again to my rescue

0 Likes

#4

Why would one want the find/find in files output to go to the buffer as opposed to the screen. To me it looks like a “make the output a load of garbage” button, so I must be missing something !?
Can one specify which buffer, in some setting, and therefore do something interesting with it ?

Cheers, Loz

0 Likes

#5

Both the buffer and the panel go to the screen, not sure what you’re asking there?

The distinction between the two is that the panel is handily tucked away at the bottom of the window, allowing you to refer to the results, jump around, hide it away and easily bring it back, while if it’s in a buffer it’s in a tab that’s explicitly named and part of the regular tab flow.

Which one of those you find more useful as an approach is up to you. In both cases you can easily select text out and do whatever with it, navigate to results, etc.

Functionally speaking, the contents of panels isn’t persisted in session information, so if you want to do a search and keep the results indefinitely you want to send them to a buffer.

0 Likes

#6

Sorry I meant tab not screen. And I’ve got Buffer/Tab the wrong way round, buffer selected => tab. Buffer not selected => panel ? I know now, cheers

0 Likes