Sublime Forum

'Where' box in search and replace all buffers

#1

If this is previously answered, my apologies for a second post.

At some point, I performed a search with a long list of files to exclude by type: Example:

-*.dds,-*.eot,-*.gif,-*.ico,-*.jar,-*.jpeg,-*.jpg,-*.log,-*.pdf,-*.png,-*.swf

Now, whenever I want to perform a global search & replace, I get the similar string in the ‘Where’ box and can not eliminate it. Not by substitutions of other criteria (which should save only the last five or so criteria in a history) or changing projects, renaming projects, etc. Every time I use this feature, I have to wipe what is in the ‘Where’ box and leave it blank which will default to Open files and folders or enter a new criteria.

Is there a file to edit and eliminate this?

Thanks in advance

0 Likes

Find in Files project setting?
#2
  1. Preferences -> Browse Packages
  2. Up a level
  3. Local
  4. Session.sublime_session
  5. Search for where_history

Note: probably best to edit this file in a different editor while ST3 is closed

2 Likes

#3

Props. kingkeith! Thank you.

0 Likes

#4

I don’t believe this. The string is in Where again and I can not get rid of it.

Using the exact string and fragments of it, I have looked in:

  1. all project files and workspace files
  2. Session.sublime_session
  3. even ran find on all files in my home directory

The only place it comes up as a string is in the search history of the software I used to edit Session.sublime_session.

I have even gone so far as to open project files and eliminate all where_history entries leaving only:

"find_in_files":
{
        "height": 102.0,
        "where_history":
        [
        ]
},

Still, the string comes up when calling a global search. I also checked the keymap file to make sure I didn’t have something trigger when Ctrl+Shift+f is pressed.

I use Ubuntu. Is there another place history might be saved in other than text string for JSON? Or, could it be cached somewhere?

0 Likes

#5

nudge. Could someone please offer input? This is really bothersome

0 Likes

#6

I was going to mention that it’s possible for where_history to appear in the session file more than once, but I assume that’s not the case since you mentioned searching your entire home directory which you presumably did after you had already edited the file.

I’m running Slackware here, not Ubuntu (although I can’t imagine how that could possibly matter) but I can’t seem to reproduce this particular problem; can you provide a short list of steps that show this happening?

For example, for me (Running ST3 3114; tested in Windows, MacOS and Linux):

  • Have some project open
  • Shift+Ctrl+F to open the Find in Files panel
  • Erase the contents of the Where: field
  • Perform search (searches open files and folders)
  • Close sublime text
  • Reopen sublime text
  • Press Shift+Ctrl+F again to reopen the Find in Files panel
  • Panel is as I left it, with an empty Where: field

The above also works with any specific contents in the Where: field, however the contents of the Where: field seem to be persisted only at the time that a search is performed; just closing the panel or quitting sublime with the text in place or cleared does not persist the change.

The only thing I can imagine is that either Sublime was open while you were editing the files in the other application and so the changes still persist anyway, or you’re running an older version of sublime that had some issue, but neither of those seem very likely at all, unfortunately.

I ran a search for a specific Where: item in one of my projects (specifically the one that was the default in my current project):

tmartin:dart:~> find . -name \* -type f -exec grep -qi "/home/tmartin/local/src/ts-breakout/ts" {} \; -print
./local/src/ts-breakout/ts-breakout.sublime-workspace
./local/src/Sublime3DefaultPackage/Sublime3DefaultPackage.sublime-workspace
./local/src/ts-game-engine/ts-game-engine.sublime-workspace
./SublimePluginStuff/SublimePluginDev.sublime-workspace
./SFML/SFML.sublime-workspace
./.config/sublime-text-3/Index/000389.ldb
./.config/sublime-text-3/Local/Session.sublime_session
./.smartgit/7/log.txt.1
./.vim_backups/Session.sublime_session~

One thing this proved is that my home directory is far too big and unwieldy because it took over 2 hours to complete. Also though, as you can see the only hits in files that are not sublime-workspace files of some sort are unrelated files. There is a hit in the sublime text 3 index, but since that’s the index of symbols and my search term was specifically the path to files that contain symbols, that’s not surprising.

1 Like

#7

Thank you for replying OdatNurd

I am running the same version of ST3. The list of steps is identical to yours except for the last point:

  • Ctrl+Shift+F to open Find in Files
  • Clear what is in the Where box either by selecting Clear from the menu which can be activated at right or by selecting all that appears in the Where box and tapping Delete or Ctrl+x
  • enter criteria for a search or a search & replace
  • execute a global search or a search & replace
  • Ctrl+Shift+F to open Find in Files to start a new search OR exit ST3, reopen the program and Ctrl+Shift+F to open Find in Files and the contents of the Where box contain the unwanted string again

I am certain I exited ST3 at the time I executed the solution set-out by kingkeith above. After executing those steps, I reopened ST3 and the Where box was empty. Exiting the software and restarting it a few minutes later I struck Ctrl+Shift+F to open Find in Files and the string was back.

As of writing this, I have scoured my home directory for fragments of the string using Kfind (a gui find tool) or grep -R "\-\*.zip", for example. The string is not found.

I am very certain this is a problem in the Home directory. Without ST3 open, I have renamed the sublime-text-3 under .config and opened ST3 without any packages , as if it is a fresh install. Striking Ctrl+Shift+F to open Find in Files and the Where box is empty.

0 Likes

#8

A puzzling mystery indeed. If it remains fixed after that, I would say that points at some package being the culprit. One problem with that (and why I didn’t also consider that a possibility above) is that if a package was persisting some setting or file in order to keep putting that string back, I would expect it to do so somewhere inside the ~/.config/sublime-text-3/Packages/User path or inside your home directory somewhere if it was being particularly naughty, but if that was the case you should have found such a file.

Out of curiosity, did you try checking under /tmp to see if any files there match? That’s about the only other place I can imagine code running as you would expect to be able to drop a file, although why anyone would persist a setting there would be a mystery all its own.

0 Likes

#9

I found the solution!

Since renaming sublime-text-3 under ~/.config/ narrowed things down to the packages or other settings, I went about removing packages until the problem went away. Opening the Package Control.sublime-settings (under sublime-text-3/Packages/User/) gave me the list of packages installed. Removing the package FindResultsApplyChanges solved this issue. I do not remember installing this package. The string being filled in to the Where box was from the preferences for the binary file patterns exclusion setting.

Problem solved!

2 Likes

#10

Awesome! I’m glad you finally got it solved. :slightly_smiling:

0 Likes

#11

Hello
Thx for the investigations, you guys helped me as well.
But i installed that package. It has a pretty cool feature. it allows to change all the files right in the search folder…
I looked in to the package and found that it had a python file called FindExcludePatterns.py which run each time that the find in files was opend.
This did nothing else then change the where to that default pattern…
So i ended up renaming this file to *.exclude and now it works…

0 Likes