File tree 1 file changed +21
-10
lines changed
1 file changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -53,16 +53,16 @@ class AdvancedEditor extends React.PureComponent<AdvancedEditorProps> {
53
53
54
54
return (
55
55
< AceEditor
56
- ref = { this . trackEditor }
57
- mode = "rust"
58
- keyboardHandler = { keybinding }
59
- theme = { theme }
60
- value = { code }
61
- onChange = { onEditCode }
62
- name = "editor"
63
- width = "100%"
64
- height = "100%"
65
- editorProps = { { $blockScrolling : true } } />
56
+ ref = { this . trackEditor }
57
+ mode = "rust"
58
+ keyboardHandler = { keybinding }
59
+ theme = { theme }
60
+ value = { code }
61
+ onChange = { onEditCode }
62
+ name = "editor"
63
+ width = "100%"
64
+ height = "100%"
65
+ editorProps = { { $blockScrolling : true } } />
66
66
) ;
67
67
}
68
68
@@ -82,6 +82,17 @@ class AdvancedEditor extends React.PureComponent<AdvancedEditorProps> {
82
82
readOnly : true ,
83
83
} ) ;
84
84
85
+ // The default keybinding of control/command-l interferes with
86
+ // the browser's "edit the location" keycommand which I think
87
+ // is way more common.
88
+ const gotoCommand = editor . commands . byName [ 'gotoline' ] ;
89
+ gotoCommand . bindKey = {
90
+ win : 'Ctrl-Shift-L' ,
91
+ mac : 'Command-Shift-L' ,
92
+ } ;
93
+ editor . commands . removeCommand ( gotoCommand . name ) ;
94
+ editor . commands . addCommand ( gotoCommand ) ;
95
+
85
96
editor . setOptions ( {
86
97
enableBasicAutocompletion : true ,
87
98
} ) ;
You can’t perform that action at this time.
0 commit comments