mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-25 09:23:17 +01:00
feat: ener keybindings for single line editor
This commit is contained in:
parent
60fc13c765
commit
ae70680ceb
@ -43,6 +43,7 @@ const QueryUrl = ({ item, collection, handleRun }) => {
|
||||
<SingleLineEditor
|
||||
value={url}
|
||||
onChange={(newValue) => onUrlChange(newValue)}
|
||||
onRun={handleRun}
|
||||
collection={collection}
|
||||
/>
|
||||
<div className="flex items-center h-full mr-2 cursor-pointer" id="send-request" onClick={handleRun}>
|
||||
|
@ -25,11 +25,44 @@ class SingleLineEditor extends Component {
|
||||
autofocus: true,
|
||||
mode: "brunovariables",
|
||||
extraKeys: {
|
||||
"Enter": () => {},
|
||||
"Ctrl-Enter": () => {},
|
||||
"Cmd-Enter": () => {},
|
||||
"Alt-Enter": () => {},
|
||||
"Shift-Enter": () => {}
|
||||
"Enter": () => {
|
||||
if (this.props.onRun) {
|
||||
this.props.onRun();
|
||||
}
|
||||
},
|
||||
"Ctrl-Enter": () => {
|
||||
if (this.props.onRun) {
|
||||
this.props.onRun();
|
||||
}
|
||||
},
|
||||
"Cmd-Enter": () => {
|
||||
if (this.props.onRun) {
|
||||
this.props.onRun();
|
||||
}
|
||||
},
|
||||
"Alt-Enter": () => {
|
||||
if (this.props.onRun) {
|
||||
this.props.onRun();
|
||||
}
|
||||
},
|
||||
"Shift-Enter": () => {
|
||||
if (this.props.onRun) {
|
||||
this.props.onRun();
|
||||
}
|
||||
},
|
||||
'Cmd-S': () => {
|
||||
if (this.props.onSave) {
|
||||
this.props.onSave();
|
||||
}
|
||||
},
|
||||
'Ctrl-S': () => {
|
||||
if (this.props.onSave) {
|
||||
this.props.onSave();
|
||||
}
|
||||
},
|
||||
'Cmd-F': () => {},
|
||||
'Ctrl-F': () => {},
|
||||
'Tab': () => {}
|
||||
},
|
||||
});
|
||||
this.editor.setValue(this.props.value)
|
||||
|
Loading…
Reference in New Issue
Block a user