Skip to content

Commit

Permalink
Add previous line hotkey to SQL editor for macOS (#19052)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomedina248 authored Mar 8, 2022
1 parent 03b2b06 commit aa0ec71
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion superset-frontend/src/SqlLab/components/SqlEditor/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ class SqlEditor extends React.PureComponent {
getHotkeyConfig() {
// Get the user's OS
const userOS = detectOS();
return [

const base = [
{
name: 'runQuery1',
key: 'ctrl+r',
Expand Down Expand Up @@ -346,6 +347,19 @@ class SqlEditor extends React.PureComponent {
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) {
Expand Down

0 comments on commit aa0ec71

Please sign in to comment.