Skip to content

Commit

Permalink
Reassign go to line to control/command-shift-l
Browse files Browse the repository at this point in the history
Closes #160
  • Loading branch information
shepmaster committed Oct 30, 2017
1 parent e74b441 commit 9413eb5
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions ui/frontend/AdvancedEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ class AdvancedEditor extends React.PureComponent<AdvancedEditorProps> {

return (
<AceEditor
ref={this.trackEditor}
mode="rust"
keyboardHandler={keybinding}
theme={theme}
value={code}
onChange={onEditCode}
name="editor"
width="100%"
height="100%"
editorProps={{ $blockScrolling: true }} />
ref={this.trackEditor}
mode="rust"
keyboardHandler={keybinding}
theme={theme}
value={code}
onChange={onEditCode}
name="editor"
width="100%"
height="100%"
editorProps={{ $blockScrolling: true }} />
);
}

Expand All @@ -82,6 +82,17 @@ class AdvancedEditor extends React.PureComponent<AdvancedEditorProps> {
readOnly: true,
});

// The default keybinding of control/command-l interferes with
// the browser's "edit the location" keycommand which I think
// is way more common.
const gotoCommand = editor.commands.byName.gotoline;
gotoCommand.bindKey = {
win: 'Ctrl-Shift-L',
mac: 'Command-Shift-L',
};
editor.commands.removeCommand(gotoCommand.name);
editor.commands.addCommand(gotoCommand);

editor.setOptions({
enableBasicAutocompletion: true,
});
Expand Down

0 comments on commit 9413eb5

Please sign in to comment.