Skip to content

Commit 3b9ad59

Browse files
committed
add hot key:Navigate up(Ctrl + P) for CodeEditor
1 parent 79e0e56 commit 3b9ad59

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lib/components/CodeEditor.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ module.exports = React.createClass({
3131
editor.setTheme('ace/theme/xcode')
3232
editor.clearSelection()
3333
editor.moveCursorTo(0, 0)
34+
editor.commands.addCommand({
35+
name: 'Emacs cursor up',
36+
bindKey: {mac: 'Ctrl-P'},
37+
exec: function (editor) {
38+
editor.navigateUp(1)
39+
},
40+
readOnly: true
41+
})
3442

3543
editor.setReadOnly(!!this.props.readOnly)
3644

0 commit comments

Comments
 (0)