The default bug view has changed. See this FAQ.

Source Editor should automatically set up Undo/Redo key bindings

RESOLVED FIXED in Firefox 11

Status

()

Firefox
Developer Tools
P3
normal
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: cedricv, Assigned: msucan)

Tracking

({dev-doc-complete})

unspecified
Firefox 11
dev-doc-complete
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [sourceeditor][good first bug][mentor=msucan][fixed-in-fx-team])

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

6 years ago
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.
(Reporter)

Comment 1

6 years ago
Created attachment 556863 [details] [diff] [review]
Source Editor should automatically set up Undo/Redo key bindings - b=683172 r=msucan
(Reporter)

Updated

6 years ago
Attachment #556863 - Flags: review?(mihai.sucan)
(Reporter)

Comment 2

6 years ago
Created attachment 556868 [details] [diff] [review]
Source Editor should automatically set up Undo/Redo key bindings - b=683172 r=msucan
(Reporter)

Updated

6 years ago
Attachment #556863 - Flags: review?(mihai.sucan)
(Reporter)

Updated

6 years ago
Attachment #556863 - Attachment is obsolete: true
(Reporter)

Updated

6 years ago
Attachment #556868 - Flags: review?(mihai.sucan)
(Assignee)

Comment 3

6 years ago
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-
(Assignee)

Comment 4

6 years ago
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
(Assignee)

Comment 7

6 years ago
Rob: I meant Gecko defaults.
Whiteboard: [sourceeditor]
yes, should use gecko defaults.

Comment 9

6 years ago
We're doing developer tool prioritization, filter on 'brontozaur'
to ignore the spam.
Priority: -- → P3
(Assignee)

Updated

5 years ago
Whiteboard: [sourceeditor] → [sourceeditor][good first bug][mentor=msucan]
(Assignee)

Comment 10

5 years ago
Created attachment 581033 [details] [diff] [review]
proposed patch

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+
(Assignee)

Comment 11

5 years ago
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
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 11
(Assignee)

Comment 14

5 years ago
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
Documented:

https://developer.mozilla.org/en/Tools/Using_the_Source_Editor#Keyboard_commands
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.