Remove ctrl-d keybinding to discard comment
The ctrl-d binding is dangerous as it removes the unsaved draft comment without confirmation and is a common keybinding when editing text (it is the emacs binding for forward-delete). Esc can still be used to discard unsaved draft comments; removing saved draft comments will now require using the mouse. Change-Id: I30120351f4be0a09ad9404d352fde1408982c05f
This commit is contained in:
@@ -86,8 +86,6 @@ public abstract class AbstractPatchContentTable extends NavigationTable<Object>
|
||||
keysComment = new KeyCommandSet(PatchUtil.C.commentEditorSet());
|
||||
keysComment.add(new NoOpKeyCommand(KeyCommand.M_CTRL, 's', PatchUtil.C
|
||||
.commentSaveDraft()));
|
||||
keysComment.add(new NoOpKeyCommand(KeyCommand.M_CTRL, 'd', PatchUtil.C
|
||||
.commentDiscard()));
|
||||
keysComment.add(new NoOpKeyCommand(0, KeyCodes.KEY_ESCAPE, PatchUtil.C
|
||||
.commentCancelEdit()));
|
||||
} else {
|
||||
|
||||
@@ -102,18 +102,6 @@ public class CommentEditorPanel extends CommentPanel implements ClickHandler,
|
||||
event.preventDefault();
|
||||
onSave(NULL_CALLBACK);
|
||||
return;
|
||||
|
||||
case 'd':
|
||||
case 'D':
|
||||
event.preventDefault();
|
||||
if (isNew()) {
|
||||
onDiscard();
|
||||
} else if (Window.confirm(PatchUtil.C.confirmDiscard())) {
|
||||
onDiscard();
|
||||
} else {
|
||||
text.setFocus(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ public interface PatchConstants extends Constants {
|
||||
String buttonSave();
|
||||
String buttonCancel();
|
||||
String buttonDiscard();
|
||||
String confirmDiscard();
|
||||
|
||||
String noDifference();
|
||||
String patchHeaderOld();
|
||||
@@ -46,7 +45,6 @@ public interface PatchConstants extends Constants {
|
||||
String commentEditorSet();
|
||||
String commentInsert();
|
||||
String commentSaveDraft();
|
||||
String commentDiscard();
|
||||
String commentCancelEdit();
|
||||
|
||||
String whitespaceIGNORE_NONE();
|
||||
|
||||
@@ -7,7 +7,6 @@ buttonEdit = Edit
|
||||
buttonSave = Save
|
||||
buttonCancel = Cancel
|
||||
buttonDiscard = Discard
|
||||
confirmDiscard = Discard this comment?
|
||||
|
||||
noDifference = No Differences
|
||||
patchHeaderOld = Old Version
|
||||
@@ -28,7 +27,6 @@ expandComment = Expand or collapse comment
|
||||
commentEditorSet = Comment Editing
|
||||
commentInsert = Create a new inline comment
|
||||
commentSaveDraft = Save draft comment
|
||||
commentDiscard = Discard draft comment
|
||||
commentCancelEdit = Cancel comment edit
|
||||
|
||||
whitespaceIGNORE_NONE=None
|
||||
|
||||
Reference in New Issue
Block a user