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

Hard to quit Brackets if file with unsaved changes has been deleted/renamed on disk #755

Closed
mikechambers opened this issue Apr 27, 2012 · 9 comments

Comments

@mikechambers
Copy link
Contributor

See comment below for detailed repro steps


Working on a JavaScript file, and tried to save it. Get the following error:

An error occured when trying to open the file

c:/Users/mesh/src/SpectralKitten/src/www/js/main.js (error 2)

Click OK to dismiss error. Try to close the browser, I am prompted to save file, click yes, get error, click cancel, brackets doesnt close.

I eventually was able to get to a point where I could close brackets (somehow the file ended up closing).

Windows 7
Brackets version 0.1
Pull the build from source on April 25th (I cant find the exact commit).

@njx
Copy link
Contributor

njx commented Apr 27, 2012

Adding medium priority. There are two problems here: the error itself, and then the fact that you can't quit.

@njx
Copy link
Contributor

njx commented Apr 27, 2012

Recommending for sprint 8

@peterflynn
Copy link
Member

I'll take a look at this

@peterflynn
Copy link
Member

I sent an email to Mike requesting more info. I'm not sure how to repro the error in saving (or even if that part was unexpected, i.e. part of the bug). Fwiw, error code #2 is SECURITY_ERR.

Second, when I artificially set up a save error (e.g. by marking file read only), quitting still works as expected: if I hit Cancel I don't quit; if I hit Don't Save I do quit; if I hit Save it get an error message and don't quit. I'm not sure whether Mike saw a different dialog, saw this dialog but it behaved incorrectly, or simply found the current behavior confusing.

@mikechambers
Copy link
Contributor Author

Sorry for the delayed response (I have been in transit today).

I havent been able to reproduce this since I ran into it.

mike

On Tue, May 1, 2012 at 2:35 PM, Peter Flynn
reply@reply.github.com
wrote:

I sent an email to Mike requesting more info.  I'm not sure how to repro the error in saving (or even if that part was unexpected, i.e. part of the bug).  Fwiw, error code #2 is SECURITY_ERR.

Second, when I artificially set up a save error (e.g. by marking file read only), quitting still works as expected: if I hit Cancel I don't quit; if I hit Don't Save I do quit; if I hit Save it get an error message and don't quit.  I'm not sure whether Mike saw a different dialog, saw this dialog but it behaved incorrectly, or simply found the current behavior confusing.


Reply to this email directly or view it on GitHub:
#755 (comment)

@peterflynn
Copy link
Member

Ok, here are steps that may describe the issue:

  1. Make edits in a file -- don't save
  2. On disk, delete or rename the file
  3. Return to Brackets; choose "Keep Changes in Editor"
  4. Try to quit Brackets
  5. In the unsaved changes confirmation, choose Don't Save -- this should drop the unsaved changes and proceed to quit

Result: you get an "Error opening file" popup, and then Brackets does not quit.

Workaround: close that one file, choose Don't Save, then quit Brackets
Or, if you don't care about keeping your changes, don't answer "Keep Changes" in step 3 :-)

@peterflynn
Copy link
Member

Pretty sure that's what Mike was seeing. Clarifying title.

peterflynn added a commit that referenced this issue May 2, 2012
with unsaved changes has been deleted/renamed on disk) -- If we're in
"promptOnly" mode we're not actually closing the file, so we shouldn't
try to reload its contents from disk.

This bug afflicted several cases: quit/window-close, reload, and switching
folders. (Switching folders is especially key, because you should be able
to cancel the subsequent folder picker and remain on the old folder without
all your files now being closed/reverted).
gruehle added a commit that referenced this issue May 3, 2012
Fix bug #755 (Hard to quit Brackets if unsaved file deleted/renamed on disk)
@peterflynn
Copy link
Member

FBNC @mikechambers -- Mike, if this resolution feels good to you, can you go ahead & close it?

@mikechambers
Copy link
Contributor Author

Looks good. Thanks for fixing.

tvoliter added a commit that referenced this issue May 3, 2012
…-no-caching

* origin/master: (93 commits)
  Update README.md
  Code review fixes
  Support single quotes and url() for images.
  fix types. Rename var.
  prevent reentrancy into handleFileNewInProject(). Add closeRenameInput() to ProjectManager to allow clients to end renaming.
  Code review cleanup
  Fix bug #755 (Unable to quit Brackets without closing file first if file with unsaved changes has been deleted/renamed on disk) -- If we're in "promptOnly" mode we're not actually closing the file, so we shouldn't try to reload its contents from disk.
  Back to array length declairation moved outside of for loop. Passing JSONLint now thanks to that fancy star :).
  remove comment. fix whitespace.
  Add .gif
  Adding experimental extensions for inline JavaScript function editor and inline image viewer.
  Revered length check back to original form as splicing the array requires another length check. Moving variable instantiation inside for loop to trim code length.
  Update README.md
  Cleaning up the loop within 'removeInlineWidgetInternal'. Moving length check of the widget list to outside of the loop to speed up iteration duration.
  add comment
  no need to add 'quiet-scrollbars' class
  remove unused z-index vars
  Added info on our use of CodeMirror
  Sort z-index vars in-order
  ui font update for vertical alignment
  ...

Conflicts:
	src/command/Commands.js
	src/search/QuickFileOpen.js
gideonthomas pushed a commit to gideonthomas/brackets that referenced this issue May 10, 2017
…sition (adobe#755)

* Fixed excessive space before the line number

* Adjusted inlineWidget position
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