Add previous line hotkey to SQL editor for macOS (#19052)

This commit is contained in:
Diego Medina 2022-03-08 16:26:36 -05:00 committed by GitHub
parent 03b2b06e90
commit aa0ec717a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 1 deletions

View File

@ -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) {