6174 / 6174/pagedown

Ctrl-z undo twice

Open
#60 0 comments 0 reactions 0 assignees View on GitHub
auto-migrated Priority-Medium Type-Defect
Dominant language
JavaScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```
When I type ctrl-z, the undo action is performed twice. Not handling the "y"
and "z" event in util.addEvent() in Markdown.Editor.js line 1255 corrects this
problem.

util.addEvent(inputBox, keyEvent, function (key) {

// Check to see if we have a button key and, if so execute the callback.
if ((key.ctrlKey || key.metaKey) && !key.altKey && !key.shiftKey) {

var keyCode = key.charCode || key.keyCode;
var keyCodeStr = String.fromCharCode(keyCode).toLowerCase();

switch (keyCodeStr) {
....
case "h":
doClick(buttons.heading);
break;
case "r":
doClick(buttons.hr);
break;
case "y":
//doClick(buttons.redo);
break;
case "z":
//if (key.shiftKey) {
// doClick(buttons.redo);
//}
//else {
// doClick(buttons.undo);
//}
break;
default:
return;
}
```

Original issue reported on code.google.com by `freepl...@gmail.com` on 1 Jun 2013 at 4:02

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.