mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-25 06:21:57 +02: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
|
<SingleLineEditor
|
||||||
value={url}
|
value={url}
|
||||||
onChange={(newValue) => onUrlChange(newValue)}
|
onChange={(newValue) => onUrlChange(newValue)}
|
||||||
|
onRun={handleRun}
|
||||||
collection={collection}
|
collection={collection}
|
||||||
/>
|
/>
|
||||||
<div className="flex items-center h-full mr-2 cursor-pointer" id="send-request" onClick={handleRun}>
|
<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,
|
autofocus: true,
|
||||||
mode: "brunovariables",
|
mode: "brunovariables",
|
||||||
extraKeys: {
|
extraKeys: {
|
||||||
"Enter": () => {},
|
"Enter": () => {
|
||||||
"Ctrl-Enter": () => {},
|
if (this.props.onRun) {
|
||||||
"Cmd-Enter": () => {},
|
this.props.onRun();
|
||||||
"Alt-Enter": () => {},
|
}
|
||||||
"Shift-Enter": () => {}
|
},
|
||||||
|
"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)
|
this.editor.setValue(this.props.value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user