Closed
Bug 942774
Opened 11 years ago
Closed 10 years ago
Files loaded into scratchpad should be recognized as “saved”
Categories
(DevTools Graveyard :: Scratchpad, defect)
DevTools Graveyard
Scratchpad
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 29
People
(Reporter: PatrickWesterhoff, Assigned: lpy)
Details
(Whiteboard: [good-first-bug][lang=js][mentor=Benvie][good first verify])
Attachments
(1 file, 1 obsolete file)
1.86 KB,
patch
|
bbenvie
:
review+
|
Details | Diff | Splinter Review |
Currently, when loading a file into Scratchpad, the file is immediately marked as “not saved” (visible by the star prepended to the file name in the title). Thus, when closing Scratchpad without actually changing the file, I still get a prompt to save it. This is obviously not necessary for files that were just loaded but never changed. The behavior is triggered by `self.setText(content);` in the `SP_importFromFile` function [1]. Setting the text will raise the `textChanged` event which in turn will put the Scratchpad editor in an unsaved state. It seems that the `textChanged` event is only being listened to when the file was saved until the first change. I would suggest solving this similarly to how it’s done in the initialization by calling `onTextSaved` after the text has been loaded from the file [3]. In addition this would require removing the listener first before starting to load the file. [1] https://hg.mozilla.org/mozilla-central/file/94a04fd2568d/browser/devtools/scratchpad/scratchpad.js#l578 [2] https://hg.mozilla.org/mozilla-central/file/94a04fd2568d/browser/devtools/scratchpad/scratchpad.js#l882 [3] https://hg.mozilla.org/mozilla-central/file/94a04fd2568d/browser/devtools/scratchpad/scratchpad.js#l792
Comment 1•11 years ago
|
||
(In reply to Patrick Westerhoff from comment #0) > This is obviously not necessary for files that were just loaded but never > changed. Agreed. Confirmed on 28.0a1 (2013-12-09), Win 7 x64.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•10 years ago
|
Whiteboard: [good-first-bug][lang=js][mentor=Benvie]
Comment 3•10 years ago
|
||
sure, Bhagya. Attach a patch and we'll set the assignee to you. Thanks!
Comment 4•10 years ago
|
||
Can you please assign this bug to me? I am interested in working on this bug.
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → pylaurent1314
Assignee | ||
Comment 5•10 years ago
|
||
The code link in description are out of date.
Attachment #8362223 -
Flags: review?(bbenvie)
Reporter | ||
Comment 6•10 years ago
|
||
Is that really all that’s necessary now to fix this? Wow, a lot seems to have happened in that file :o
Assignee | ||
Comment 7•10 years ago
|
||
The |set dirty| will call |setClean| in the editor and update the title. I think that can solve this problem. Any suggestion appreciated. [1]http://dxr.mozilla.org/mozilla-central/source/browser/devtools/scratchpad/scratchpad.js#164
Comment 8•10 years ago
|
||
This looks like the correct fix, but I'd also like to see a test added to confirms this behavior so it won't break in the future again. You should be able to add a check somewhere around [1] to confirm that gScratchpad.dirty is false. [1] http://mxr.mozilla.org/mozilla-central/source/browser/devtools/scratchpad/test/browser_scratchpad_files.js#45
Updated•10 years ago
|
Attachment #8362223 -
Flags: review?(bbenvie)
Assignee | ||
Comment 9•10 years ago
|
||
Test added. Thank you.
Attachment #8362223 -
Attachment is obsolete: true
Attachment #8362344 -
Flags: review?(bbenvie)
Comment 10•10 years ago
|
||
Comment on attachment 8362344 [details] [diff] [review] bug942774-V2.patch Review of attachment 8362344 [details] [diff] [review]: ----------------------------------------------------------------- Thanks! LGTM pending a green try. https://tbpl.mozilla.org/?tree=Try&rev=46ff5902f513
Attachment #8362344 -
Flags: review?(bbenvie) → review+
Comment 11•10 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/cbb2876bdaf3
Whiteboard: [good-first-bug][lang=js][mentor=Benvie] → [good-first-bug][lang=js][mentor=Benvie][fixed-in-fx-team]
Comment 12•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/cbb2876bdaf3
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [good-first-bug][lang=js][mentor=Benvie][fixed-in-fx-team] → [good-first-bug][lang=js][mentor=Benvie]
Target Milestone: --- → Firefox 29
Updated•10 years ago
|
Whiteboard: [good-first-bug][lang=js][mentor=Benvie] → [good-first-bug][lang=js][mentor=Benvie][good first verify]
Updated•6 years ago
|
Product: Firefox → DevTools
Updated•4 years ago
|
Product: DevTools → DevTools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•