Closed
Bug 700893
Opened 13 years ago
Closed 12 years ago
API for tracking unsaved/saved state in source editor
Categories
(DevTools Graveyard :: Scratchpad, defect)
DevTools Graveyard
Scratchpad
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 13
People
(Reporter: harth, Assigned: msucan)
References
Details
(Keywords: dev-doc-complete, Whiteboard: [sourceeditor])
Attachments
(1 file, 1 obsolete file)
30.07 KB,
patch
|
rcampbell
:
review+
harth
:
feedback+
|
Details | Diff | Splinter Review |
As brought up in bug 669612, there should be a way to tell the source editor "this text is 'saved'", and a way to query whether the text is still in that 'saved' state, across changes and undos.
Comment 1•13 years ago
|
||
Perhaps it would make sense to implement the Save to file feature within SourceEditor to avoid duplication as well?
Assignee | ||
Comment 2•13 years ago
|
||
(In reply to Cedric Vivier [cedricv] from comment #1) > Perhaps it would make sense to implement the Save to file feature within > SourceEditor to avoid duplication as well? Interesting idea. Currently I want to keep the Source Editor a "text widget" with the common features needed to build the UI of devtools, for source code editing. Syntax highlighting, rulers, autocomplete and so on. Saving files is what the user of the Source Editor might want to do, but not always. We'll see, in the future. The Orion editor upstream has the concept of tracking the "dirty"/saved/unsaved state. Save is also a command that is implemented externally - it's up to the integrator what save means. That's what I imagine for our Source Editor as well. We just didn't (yet) take in this part of their code. We'll see in the future. Anyhow, this bug is about the saved state. :)
Whiteboard: [sourceeditor]
Version: unspecified → Trunk
Comment 3•13 years ago
|
||
One potential way to implement this would be to verify the content's of the editor's undo stack. If the stack is empty, the file is back to "saved" or "unchanged". If there are undos on the stack, then the file is considered modified. This seems to match up with the way other editors (e.g., TextMate) check their modified state.
Updated•13 years ago
|
Component: Developer Tools → Developer Tools: Scratchpad
QA Contact: developer.tools → developer.tools.scratchpad
Assignee | ||
Comment 4•12 years ago
|
||
This now blocks bug 684445 because we need a proper way to update the undo/redo xul:commands. I already have patches in the works for both bugs.
Assignee | ||
Comment 5•12 years ago
|
||
Proposed patch. Note that this also fixes bug 723057.
Attachment #593586 -
Flags: review?(rcampbell)
Assignee | ||
Comment 6•12 years ago
|
||
Attachment #593586 -
Attachment is obsolete: true
Attachment #593586 -
Flags: review?(rcampbell)
Attachment #595790 -
Flags: review?(rcampbell)
Assignee | ||
Comment 7•12 years ago
|
||
The new Source Editor API event, DIRTY_CHANGED, and the new editor.dirty property need to be documented. Example use is in scratchpad.js. Thank you!
Keywords: dev-doc-needed
Comment 8•12 years ago
|
||
Comment on attachment 595790 [details] [diff] [review] [in-fx-team] rebased patch solid. I wish I had some comments for you, but it all looks ok to my pre-caffeinated self. You could ask harth for feedback around the Scratchpad title-marking and saving stuff and I will do so.
Attachment #595790 -
Flags: review?(rcampbell)
Attachment #595790 -
Flags: review+
Attachment #595790 -
Flags: feedback?(fayearthur)
Assignee | ||
Comment 9•12 years ago
|
||
Thanks Rob for the r+! Yep, it makes sense to ask Heather for a feedback round. Looking forward to her feedback!
Reporter | ||
Comment 10•12 years ago
|
||
Comment on attachment 595790 [details] [diff] [review] [in-fx-team] rebased patch looks good to me too.
Attachment #595790 -
Flags: feedback?(fayearthur) → feedback+
Assignee | ||
Comment 11•12 years ago
|
||
Comment on attachment 595790 [details] [diff] [review] [in-fx-team] rebased patch Landed: https://hg.mozilla.org/integration/fx-team/rev/5b33f5c7e630
Attachment #595790 -
Attachment description: rebased patch → [in-fx-team] rebased patch
Assignee | ||
Comment 12•12 years ago
|
||
Thanks Heather for the f+!
Whiteboard: [sourceeditor] → [sourceeditor][fixed-in-fx-team]
Comment 13•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/5b33f5c7e630
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [sourceeditor][fixed-in-fx-team] → [sourceeditor]
Target Milestone: --- → Firefox 13
Comment 14•12 years ago
|
||
This is already documented on: https://developer.mozilla.org/en/JavaScript_code_modules/source-editor.jsm Added to Firefox 13 for developers.
Keywords: dev-doc-needed → dev-doc-complete
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
•