From 781c80128564c6467a278a30dfcdd8f74943232e Mon Sep 17 00:00:00 2001 From: Diego Medina Date: Mon, 7 Mar 2022 20:56:09 -0300 Subject: [PATCH] Add previous line hotkey to SQL editor for macOS --- .../src/SqlLab/components/SqlEditor/index.jsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx b/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx index 0a3008d2f3e2a..168a53d52b1a0 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx +++ b/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx @@ -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', @@ -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) {