mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
Add previous line hotkey to SQL editor for macOS (#19052)
This commit is contained in:
@@ -306,7 +306,8 @@ class SqlEditor extends React.PureComponent {
|
|||||||
getHotkeyConfig() {
|
getHotkeyConfig() {
|
||||||
// Get the user's OS
|
// Get the user's OS
|
||||||
const userOS = detectOS();
|
const userOS = detectOS();
|
||||||
return [
|
|
||||||
|
const base = [
|
||||||
{
|
{
|
||||||
name: 'runQuery1',
|
name: 'runQuery1',
|
||||||
key: 'ctrl+r',
|
key: 'ctrl+r',
|
||||||
@@ -346,6 +347,19 @@ class SqlEditor extends React.PureComponent {
|
|||||||
func: this.stopQuery,
|
func: this.stopQuery,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (userOS === 'MacOS') {
|
||||||
|
base.push({
|
||||||
|
name: 'previousLine',
|
||||||
|
key: 'ctrl+p',
|
||||||
|
descr: t('Previous Line'),
|
||||||
|
func: editor => {
|
||||||
|
editor.navigateUp(1);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return base;
|
||||||
}
|
}
|
||||||
|
|
||||||
setQueryEditorSql(sql) {
|
setQueryEditorSql(sql) {
|
||||||
|
|||||||
Reference in New Issue
Block a user