Skip to content

Commit d79eec5

Browse files
authored
fix(settings): name Command-[ Outdent and Command-] Indent to match the editor (#3065)
Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
1 parent 7d7499a commit d79eec5

4 files changed

Lines changed: 22 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
359359
- Destination folder and the first database reading as one path in the backup result sheet. (#3046)
360360
- Only the last line of a failed backup's error shown, which on `pg_dump` is the hint rather than the cause.
361361
- Backup failure reported as an exit code alone when the tool wrote its message and exited at once.
362+
- Indent and Outdent named the wrong way round for Command-[ and Command-] in Settings > Keyboard.
362363
- Table, routine or type missing from the sidebar or Open Quickly when a period in its quoted name matched another's.
363364
- Show Previous Tab and Show Next Tab listed twice in the Window menu.
364365
- Control-Tab and Control-Shift-Tab indenting a multi-line selection in the SQL editor.

TablePro/Models/UI/KeyboardShortcutModels.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ extension ShortcutAction {
346346
/// editor-context binding.
347347
static let editorBuiltIns: [(key: BoundKey, name: String)] = [
348348
(.character("/", command: true), String(localized: "Toggle Comment")),
349-
(.character("[", command: true), String(localized: "Indent")),
350-
(.character("]", command: true), String(localized: "Outdent")),
349+
(.character("[", command: true), String(localized: "Outdent")),
350+
(.character("]", command: true), String(localized: "Indent")),
351351
(.character("d", command: true, shift: true), String(localized: "Duplicate Line")),
352352
(.character("k", command: true, shift: true), String(localized: "Delete Line")),
353353
(.special(.space, control: true), String(localized: "Show Completions")),

TableProTests/Models/KeyboardShortcutTests.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,21 @@ struct ShortcutActionDefaultsTests {
5555
}
5656
}
5757

58+
@Suite("Editor built-in shortcut names")
59+
struct EditorBuiltInNameTests {
60+
@Test("Command-[ is Outdent and Command-] is Indent")
61+
func bracketsAreNamedAsTheEditorMapsThem() {
62+
#expect(
63+
ShortcutAction.reservedConflict(for: .character("[", command: true), context: .editor)
64+
== String(localized: "Outdent")
65+
)
66+
#expect(
67+
ShortcutAction.reservedConflict(for: .character("]", command: true), context: .editor)
68+
== String(localized: "Indent")
69+
)
70+
}
71+
}
72+
5873
@Suite("Default shortcut hygiene")
5974
struct DefaultShortcutHygieneTests {
6075
/// Control-Tab is not a system hotkey the way Control-1 is (that one switches Spaces, which is

docs/features/keyboard-shortcuts.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ title: Keyboard Shortcuts
33
description: Every keyboard shortcut in TablePro, plus how to rebind them in Settings > Keyboard
44
---
55

6-
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**.
6+
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**.
77

88
## Same key, different pane
99

1010
| Key | In the SQL editor | In the data grid |
1111
|-----|-------------------|------------------|
12-
| `Cmd+[` and `Cmd+]` | Indent and outdent | Previous and next page |
12+
| `Cmd+[` and `Cmd+]` | Outdent and indent | Previous and next page |
1313
| `Cmd+F` | Find in the text | Find in the loaded rows |
1414
| `Cmd+Delete` | Delete to the start of the line | Delete the selected rows |
1515
| `Option+Delete` | Delete the previous word | Truncate the tables selected in the sidebar |
@@ -65,8 +65,8 @@ The grid meanings come back the moment you click into the grid, and `Delete` on
6565
| Action | Shortcut |
6666
|--------|----------|
6767
| Toggle comment | `Cmd+/` |
68-
| Indent | `Cmd+[` |
69-
| Outdent | `Cmd+]` |
68+
| Indent | `Cmd+]` |
69+
| Outdent | `Cmd+[` |
7070
| Duplicate line | `Cmd+Shift+D` |
7171
| Delete line | `Cmd+Shift+K` |
7272
| Move line up | `Option+Up` |

0 commit comments

Comments
 (0)