Skip to content

Commit

Permalink
Merge pull request #1624 from quadratichq/add-back-cmd+r
Browse files Browse the repository at this point in the history
Adds back cmd+r to reload the page
  • Loading branch information
davidfig committed Jul 30, 2024
2 parents ed4d7c8 + b86974d commit 8505aea
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ class InlineEditorKeyboard {
inlineEditorHandler.close(0, 1, false);
}

// Shift+Enter key
else if (matchShortcut('save_inline_editor_move_up', e)) {
e.stopPropagation();
inlineEditorHandler.close(0, -1, false);
}

// Tab key
else if (matchShortcut('save_inline_editor_move_right', e)) {
e.stopPropagation();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { debug } from '@/app/debugFlags';
import { sheets } from '@/app/grid/controller/Sheets.js';
import { matchShortcut } from '@/app/helpers/keyboardShortcuts.js';
import { javascriptWebWorker } from '@/app/web-workers/javascriptWebWorker/javascriptWebWorker.js';
Expand Down Expand Up @@ -143,7 +144,8 @@ export function keyboardViewport(options: {
}

// Fill right
if (matchShortcut('fill_right', event)) {
// Disabled in debug mode, to allow page reload
if (!debug && matchShortcut('fill_right', event)) {
const cursor = sheets.sheet.cursor;
if (cursor.columnRow?.all || cursor.columnRow?.rows) return true;
if (cursor.columnRow?.columns && cursor.multiCursor) return true;
Expand Down
1 change: 1 addition & 0 deletions quadratic-client/src/app/keyboard/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const ActionEnum = z.enum([
'show_cell_type_menu',
'close_inline_editor',
'save_inline_editor',
'save_inline_editor_move_up',
'save_inline_editor_move_right',
'save_inline_editor_move_left',
'remove_inserted_cells',
Expand Down
11 changes: 9 additions & 2 deletions quadratic-client/src/app/keyboard/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ export const defaultShortcuts: Shortcuts = [
{
action: 'edit_cell',
shortcuts: {
mac: ['Enter', 'F2'],
windows: ['Enter', 'F2'],
mac: ['Enter', 'Shift + Enter', 'F2'],
windows: ['Enter', 'Shift + Enter', 'F2'],
},
},
{
Expand Down Expand Up @@ -440,6 +440,13 @@ export const defaultShortcuts: Shortcuts = [
windows: ['Enter'],
},
},
{
action: 'save_inline_editor_move_up',
shortcuts: {
mac: ['Shift + Enter'],
windows: ['Shift + Enter'],
},
},
{
action: 'save_inline_editor_move_right',
shortcuts: {
Expand Down

0 comments on commit 8505aea

Please sign in to comment.