Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Destination folder and the first database reading as one path in the backup result sheet. (#3046)
- Only the last line of a failed backup's error shown, which on `pg_dump` is the hint rather than the cause.
- Backup failure reported as an exit code alone when the tool wrote its message and exited at once.
- Indent and Outdent named the wrong way round for Command-[ and Command-] in Settings > Keyboard.
- Table, routine or type missing from the sidebar or Open Quickly when a period in its quoted name matched another's.
- Show Previous Tab and Show Next Tab listed twice in the Window menu.
- Control-Tab and Control-Shift-Tab indenting a multi-line selection in the SQL editor.
Expand Down
4 changes: 2 additions & 2 deletions TablePro/Models/UI/KeyboardShortcutModels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ extension ShortcutAction {
/// editor-context binding.
static let editorBuiltIns: [(key: BoundKey, name: String)] = [
(.character("/", command: true), String(localized: "Toggle Comment")),
(.character("[", command: true), String(localized: "Indent")),
(.character("]", command: true), String(localized: "Outdent")),
(.character("[", command: true), String(localized: "Outdent")),
(.character("]", command: true), String(localized: "Indent")),
(.character("d", command: true, shift: true), String(localized: "Duplicate Line")),
(.character("k", command: true, shift: true), String(localized: "Delete Line")),
(.special(.space, control: true), String(localized: "Show Completions")),
Expand Down
15 changes: 15 additions & 0 deletions TableProTests/Models/KeyboardShortcutTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ struct ShortcutActionDefaultsTests {
}
}

@Suite("Editor built-in shortcut names")
struct EditorBuiltInNameTests {
@Test("Command-[ is Outdent and Command-] is Indent")
func bracketsAreNamedAsTheEditorMapsThem() {
#expect(
ShortcutAction.reservedConflict(for: .character("[", command: true), context: .editor)
== String(localized: "Outdent")
)
#expect(
ShortcutAction.reservedConflict(for: .character("]", command: true), context: .editor)
== String(localized: "Indent")
)
}
}

@Suite("Default shortcut hygiene")
struct DefaultShortcutHygieneTests {
/// Control-Tab is not a system hotkey the way Control-1 is (that one switches Spaces, which is
Expand Down
8 changes: 4 additions & 4 deletions docs/features/keyboard-shortcuts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ title: Keyboard Shortcuts
description: Every keyboard shortcut in TablePro, plus how to rebind them in Settings > Keyboard
---

Focus decides what a key does: `Cmd+[` indents in the SQL editor and pages back in the data grid, and neither one shadows the other. Everything here is the shipped default, and most of it is rebindable in **Settings > Keyboard**.
Focus decides what a key does: `Cmd+[` outdents in the SQL editor and pages back in the data grid, and neither one shadows the other. Everything here is the shipped default, and most of it is rebindable in **Settings > Keyboard**.

## Same key, different pane

| Key | In the SQL editor | In the data grid |
|-----|-------------------|------------------|
| `Cmd+[` and `Cmd+]` | Indent and outdent | Previous and next page |
| `Cmd+[` and `Cmd+]` | Outdent and indent | Previous and next page |
| `Cmd+F` | Find in the text | Find in the loaded rows |
| `Cmd+Delete` | Delete to the start of the line | Delete the selected rows |
| `Option+Delete` | Delete the previous word | Truncate the tables selected in the sidebar |
Expand Down Expand Up @@ -65,8 +65,8 @@ The grid meanings come back the moment you click into the grid, and `Delete` on
| Action | Shortcut |
|--------|----------|
| Toggle comment | `Cmd+/` |
| Indent | `Cmd+[` |
| Outdent | `Cmd+]` |
| Indent | `Cmd+]` |
| Outdent | `Cmd+[` |
| Duplicate line | `Cmd+Shift+D` |
| Delete line | `Cmd+Shift+K` |
| Move line up | `Option+Up` |
Expand Down
Loading