Sublime Forum

Find > Use Selection for Find (Cmd-E) interprets as fixed string when regex is enabled

#1

When using the “Use Selection for Find” feature, if the “interpret as regex” button (.*)in the Find dialog is set the copied text is always interpreted as a non-regex string. You have to uncheck then recheck the .* button to make Find interpret the Cmd-E copied string as a regex string.

I hope that make sense. In other words, my Find dialog is configured to interpret the search string as a regex string (meaning the .* button is enabled). But, copying a string into the Find dialog by way of the Cmd-E button (“Use Selection for Find”) seems to force the search string as a fixed string, not as a regex string, despite the state of the .* button.

Would be better if either the state of the .* button was respected OR the .* button was automatically cleared upon using the Cmd-E action. I prefer that the .* button be respected, as it would also imply that the other Find buttons (Aa and "" etc.) should also be respected.

0 Likes

#2

I’m finding behavior that seems similar to this post in the latest ST4 dev (4131). Unfortunately, I’m not entirely sure how to replicate this, but I’ve been noticing it happen frequently.

I’ll select a $variable and cmd-e, then cmd-g to find the next occurrence (very handy and something I do a lot), and it won’t find anything, even though I know there are occurrences. I noticed that it’s showing Unable to find \b\$variable\b in the console when I cmd-g.

Screen-Shot-2022-04-16-15-40-51

However, if I open up find dialog, toggle regex on & off, then it will work fine to cmd-e and cmd-g to find that same string.

Any ideas what this might be?

0 Likes