Sublime Forum

Find in files history not saving with 3143 build

#1

With 3143 I always get empty history for find in file.
Had to downgrade back to 3126 - and it works again.
Anyone else?

1 Like

#2

This was added intentionally back in build 3135:

New windows start with an empty find history

In build 3141 it was changed slightly:

Find settings, but not history, are now inherited by new windows

The history is still maintained within the current work space, so if you use projects your history is still there if you remain in the same window, but you lose it when you create a new window.

0 Likes

#3

I see. So if I create a project, find history will be saved for that particular project?

0 Likes

#4

That’s correct, yes. Every project will have an associated sublime-workspace file (automatically created) which maintains state such as what files are open, editor layout, etc. One of the things stored there is the history for the find panels as well as the Where: filter for find in files.

1 Like

#5

Is there any setting that can revert this change? I close the window at the end of the day, only to open it and find that my painstakingly crafted “Where:” exceptions are gone! This is a major frustration.

2 Likes

#6

There is no setting that controls this particular behaviour, no; or at least none that I’m, aware of or is documented in the default settings.

When you say “close the window at the end of the day”, are you referring to closing the window (but leaving Sublime running) and then creating a new window the next day, or actually fully quitting Sublime?

In the first case, without using a project to have a workspace persisted for the window, I don’t think there’s any way to retain the history since the new behaviour explicitly starts new windows without a find history present.

In the second case, turning the hot_exit setting on will cause Sublime to persist the state of everything (including all windows and their history) automatically when you Quit Sublime and then recreate them (history and all) the next time you start up.

If you happen to be using MacOS, then things get “weird” due to how applications are supposed to behave on MacOS.

Here closing the last window doesn’t quit Sublime, it just leaves it running with no windows present. If you try to launch Sublime while it’s already running, or even just click on the dock icon while it’s presenting no windows, it will create a new empty window by default.

This can give you the illusion that you’re quitting Sublime by closing the window and then starting it again when in reality it’s been running the whole time. You can verify this by turning on the option that makes the dock show an indicator on apps that are actually running, for example.

Another potential issue in this case is closing all of the windows and then quitting Sublime. When you do that, the state that you’re persisting with hot_exit is a state with no windows present, so there’s nothing but a new empty window to be created at the next launch.

Either way the solution to that problem is to ensure that hot_exit is turned on and then get in the habit of quitting Sublime entirely instead of closing the window when you’re done with it.

1 Like

#7

I am fully quitting Sublime (Command-Q) at the end of each day. It’s just a habit. Maybe I shouldn’t, but I do. I have hot_exit set to true. I recall a few versions ago (while still in beta) I would go months with my settings in the middle field of the Find in Files pane persisting. I had things like -/node_modules/*, -*min.css, -*min.js etc in there. Now, I guess I’ll just have to keep Sublime running with the window open indefinitely. :expressionless:

Or maybe make the jump to PHP Storm.

0 Likes

#8

For whatever it’s worth, I agree with unclo that this new behavior is undesirable.

3 Likes

#9

For me this is not an improvement. I read the changelog for updates when I install them, so I knew what was happening, but it took a while to find how annoying this is.

There are only a few Where: queries I use but each is a bit complicated, losing them reduces the utility of find all.

Even losing the Find: history is bad:

  • regexes are powerful
  • they are faster to re-select than retype, and less error prone when I want identical queries on multiple windows
  • creating or switching windows does not mean switching what thing I am working on, usually it is a new view for a related thing

I liked the other improvements in 3153 but this is enough of a problem that I might have to downgrade.

2 Likes

#10

I agree, this is quite frustrating.

Although, what I would really like to see is a setting with predefined “where” patterns, like:

"where_patterns": {
  "scala": "-*/target/*, ...",
  "node": "-*/node_modules/*, ..."
  ...
}

History for me is more of a replacement that works good enough.

1 Like

#11
  • Start Sublime
  • Cmd-Shift-F, Add existing Folder, search something
  • Cmd-Q
  • ReStart Sublime
  • Cmd-Shift-F, History available
  • Cmd-W (for all Windows)
  • Cmd-N
  • Cmd-Shift-F, History gone
0 Likes

#12

The pattern @yresk outlined is undesirable because I like to close every last thing in everything. I don’t think it’s uncommon to work without projects or in multiple projects with the same languages (and needing same regexes).

I’m disappointed to see this Apple-esque approach to making an opinionation about-face, especially without configuration options to get the old behavior back. I’d be uncomfortable implementing a stir-the-pot “feature”.

Can we have new_window_settings back in some form?

0 Likes

Defective OS X anonymous projects - broken layout, search history behaviour