Home Download Buy Blog Forum Support

BUG: deleted files rise from the dead

BUG: deleted files rise from the dead

Postby forehead on Sat Oct 15, 2011 10:17 pm

I guess it's nearly Halloween, since zombie files are rising to eat our brains!

Steps to reproduce:

* create a file from terminal ("echo foo > foo.txt")
* open file in ST2 (double click foo.txt in sidebar)
* delete file from terminal ("rm foo.txt")
* note that the file disappears (zoop!) from the sidebar in ST2
* switch back to ST2
* note that the foo.txt tab is *still open* and is marked as dirty
* switch back to terminal
* note that the file has been recreated in the file system

Part of this is probably cause I have "save on focus lost" set, but when ST2 notices that a file has been deleted it should close its tab, not just remove it from the sidebar.
forehead
 
Posts: 20
Joined: Wed Oct 05, 2011 10:32 pm

Re: BUG: deleted files rise from the dead

Postby jps on Sat Oct 15, 2011 11:23 pm

forehead wrote:when ST2 notices that a file has been deleted it should close its tab, not just remove it from the sidebar.

I suspect that would trip up many users.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: BUG: deleted files rise from the dead

Postby atomi on Sun Oct 16, 2011 6:38 am

jps wrote:
forehead wrote:when ST2 notices that a file has been deleted it should close its tab, not just remove it from the sidebar.

I suspect that would trip up many users.


This is just an additional perspective.
Every editor I've used (IDEA, Eclipse, Notepad 2, even Dreamweaver & Homesite) maintained the file open when that file has been deleted outside of the editor. The reasons for this I can only guess because thinking about it a bit I don't see why an editor shouldn't close a file on it's own if it's been deleted. Perhaps it was a technical limitation at the time of inception and now merely customary.
atomi
 
Posts: 342
Joined: Thu Jan 20, 2011 5:06 pm
Location: Los Angeles CA US

Re: BUG: deleted files rise from the dead

Postby tito on Sun Oct 16, 2011 4:35 pm

IMO no editor should create a file on disc, close a tab, or reload a tab without asking first. These action can lead to "lose data". These actions are very welcome if these are configurable. With the default to false, then "no surprises".
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 855
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: BUG: deleted files rise from the dead

Postby forehead on Wed Oct 19, 2011 6:49 pm

When I delete a file ("rm foo.txt") or move it ("mv foo.txt bar.txt") I want it to stay deleted. My text editor *must* not recreate it in its old location. It also must not keep open a buffer to it in its old location, cause then when I edit it, my changes are going into the wrong file.

This is not a minor issue. It has already cost me time and heartache.

> IMO no editor should create a file on disc

Yeah, that's what ST is doing now. It's creating foo.txt after I deleted it.

> close a tab

Um... what?

> or reload a tab

Sure it should. TextMate does that, for instance, and I don't find that behavior confusing at all. If you want a warning for this, fine, but I also want the option to turn that warning off.

I think you may be lamenting the lack of version control, a la IntelliJ/RubyMine, but that's a separate feature request.
forehead
 
Posts: 20
Joined: Wed Oct 05, 2011 10:32 pm

Re: BUG: deleted files rise from the dead

Postby jps on Wed Oct 19, 2011 10:58 pm

forehead wrote:> IMO no editor should create a file on disc

Yeah, that's what ST is doing now. It's creating foo.txt after I deleted it.

No, it doesn't. It'll only recreate the file if you press save.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: BUG: deleted files rise from the dead

Postby forehead on Thu Oct 20, 2011 12:45 am

Or if I have "save on focus lost" enabled. Which I do. With that setting, merely switching to ST2 and then switching away (re)creates a file.
forehead
 
Posts: 20
Joined: Wed Oct 05, 2011 10:32 pm

Re: BUG: deleted files rise from the dead

Postby jps on Thu Oct 20, 2011 5:14 am

forehead wrote:Or if I have "save on focus lost" enabled. Which I do. With that setting, merely switching to ST2 and then switching away (re)creates a file.

I can see how that would be annoying.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: BUG: deleted files rise from the dead

Postby tito on Thu Oct 20, 2011 9:06 am

A list of behaviors I really wish to have just an option to disable:

  • I have a "clean" opened file called "some.txt", someone else in the network open the same file made a change and save. The file is reloaded without alerting me. When I have a dirty file and someone else change the file I'm alerted that's great!
Ok, I was unable to reproduce more unwanted behaviors.

I can vaguely ( or wrong ) remember that for some reason the editor "close a tab" by it-self without asking, probably by deleting a file or something like that. With the latest dev build I can't repro this. This happens?

Thank you!
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 855
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 23 guests