Closed Bug 683172 Opened 13 years ago Closed 13 years ago

Source Editor should automatically set up Undo/Redo key bindings

Categories

(DevTools :: General, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 11

People

(Reporter: cedricv, Assigned: msucan)

Details

(Keywords: dev-doc-complete, Whiteboard: [sourceeditor][good first bug][mentor=msucan][fixed-in-fx-team])

Attachments

(1 file, 2 obsolete files)

Of the following basic editing features that should be default:

cut/copy/past/select all/undo/redo  

The two latter (Undo and Redo) are not supported automatically by SourceEditor currently.
Orion Key bindings should probably be registered in _initEditorFeatures... it might be worth to expose a disableEditorFeatures boolean to config object so that a consumer of SourceEditor can get full control if needed.
Attachment #556863 - Flags: review?(mihai.sucan)
Attachment #556863 - Flags: review?(mihai.sucan)
Attachment #556863 - Attachment is obsolete: true
Attachment #556868 - Flags: review?(mihai.sucan)
Comment on attachment 556868 [details] [diff] [review]
Source Editor should automatically set up Undo/Redo key bindings - b=683172 r=msucan

Thanks for your bug report and quick patch! Quick comments:

- key bindings need to be localizable.
- please use "undo" and "redo" as action names (standard in upstream Orion).
- we need a test as well.
- please update scratchpad accordingly. I assume you need to remove the <key> xul elements from scratchpad.xul.

Giving r- for now. Looking forward for the updated patch. Thanks again!
Attachment #556868 - Flags: review?(mihai.sucan) → review-
Not sure, but maybe we need to use the system default undo/redo keys. Rob, any thoughts?
System default, you mean OS defaults or Gecko defaults? If you mean Gecko defaults for whichever locale it's in, then yes.
little book-keeping here so we know who's working on this.
Assignee: nobody → cedricv
Status: NEW → ASSIGNED
Rob: I meant Gecko defaults.
Whiteboard: [sourceeditor]
yes, should use gecko defaults.
We're doing developer tool prioritization, filter on 'brontozaur'
to ignore the spam.
Priority: -- → P3
Whiteboard: [sourceeditor] → [sourceeditor][good first bug][mentor=msucan]
Attached patch proposed patchSplinter Review
Proposed patch. Things to note:

- I looked into how I can use the Gecko default keybindings and it seems that the textarea implementation is pretty much hard coded (ctrl/cmd-z and ctrl/cmd-shift-z).

- in scratchpad.xul we need to keep the <key> element, so we can have the shortcuts visible in the menus.

Please let me know if this is fine. Looking forward to your review. Thanks!


I looked into adding an nsIController for the SourceEditor, but it didn't work well, so I did bail out for now. It would be "over-engineered" for this bug alone. Anyhow, I think it might make sense, for the future, to have an nsIController that calls the Orion API for the most common cmd_* stuff. Is this worth a separate bug, what do you think?


(Cedric has agreed with me taking this bug.)
Assignee: cedricv → mihai.sucan
Attachment #556868 - Attachment is obsolete: true
Attachment #581033 - Flags: review?(rcampbell)
Attachment #581033 - Flags: review?(rcampbell) → review+
Thank you Rob!
Whiteboard: [sourceeditor][good first bug][mentor=msucan] → [sourceeditor][good first bug][mentor=msucan][land-in-fx-team]
https://hg.mozilla.org/integration/fx-team/rev/c135571daddf
Whiteboard: [sourceeditor][good first bug][mentor=msucan][land-in-fx-team] → [sourceeditor][good first bug][mentor=msucan][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/c135571daddf
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 11
The addition of the default Undo/Redo keyboard shortcuts in Firefox 11 to the Source Editor should be documented. Thank you!
Keywords: dev-doc-needed
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: