Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Confusing that "replace on disk" sometimes includes files listed in working set #8160

Open
peterflynn opened this issue Jun 18, 2014 · 6 comments

Comments

@peterflynn
Copy link
Member

  1. Add enough files to your working set to pass FindInFilesUI.MAX_IN_MEMORY (you can edit it locally to make this easier)
  2. Add two files into the working set that both contain a given string
  3. Restart Brackets, leaving selection on the first file -- so the second file has not actually been opened yet
  4. Do a Replace In Files on that string
  5. Accept the dialog that says Brackets will modify "unopened files" on disk

Result: The 1st file you added to the working set is dirty, but the 2nd file isn't. The 2nd file has been modified directly on disk.

Technically it's true that the 2nd file hasn't been opened yet, but it probably doesn't seem that way to the user.

We can either:
(a) tweak the string to make this more clear, or
(b) change FindUtils._doReplaceInOneFile() to always force-open files that are already listed in the working set (which hopefully won't lead to us overshooting MAX_IN_MEMORY by too much...)

@njx
Copy link
Member

njx commented Jun 18, 2014

Good point. (b) sounds right to me and shouldn't be too hard to implement.

@njx
Copy link
Member

njx commented Jun 18, 2014

(In fact I think that was the original intent, and I just forgot to implement it.)

@njx
Copy link
Member

njx commented Jun 18, 2014

Oh, I see the problem...it's in the working set but not "open". I missed that little detail. So this is really an edge case, not as big a deal as I originally thought. Still, easy enough to fix.

@njx njx changed the title [ReplaceInFiles] Confusing that "replace on disk" sometimes includes files listed in working set Confusing that "replace on disk" sometimes includes files listed in working set Jun 19, 2014
@njx
Copy link
Member

njx commented Jun 19, 2014

Removing "[ReplaceInFiles]" tag since this is now in master.

@njx
Copy link
Member

njx commented Jun 19, 2014

Marking low priority, fix in progress to me - fix is in #8172

@redmunds redmunds assigned peterflynn and unassigned njx Jun 20, 2014
@redmunds
Copy link
Contributor

FBNC back to @peterflynn .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants