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
(cherry picked from commit aa0ec71)
  • Loading branch information
diegomedina248 authored and villebro committed Apr 3, 2022
1 parent 4b8fc06 commit 8bef059
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 8bef059

Please sign in to comment.