diff --git a/CHANGELOG.md b/CHANGELOG.md index 940b7b8e48..1f0168fffc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/TablePro/Models/UI/KeyboardShortcutModels.swift b/TablePro/Models/UI/KeyboardShortcutModels.swift index a4cde30422..4d914764c9 100644 --- a/TablePro/Models/UI/KeyboardShortcutModels.swift +++ b/TablePro/Models/UI/KeyboardShortcutModels.swift @@ -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")), diff --git a/TableProTests/Models/KeyboardShortcutTests.swift b/TableProTests/Models/KeyboardShortcutTests.swift index 1cadc86ebc..ae4c4264af 100644 --- a/TableProTests/Models/KeyboardShortcutTests.swift +++ b/TableProTests/Models/KeyboardShortcutTests.swift @@ -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 diff --git a/docs/features/keyboard-shortcuts.mdx b/docs/features/keyboard-shortcuts.mdx index f40e7bc294..3fb17e4225 100644 --- a/docs/features/keyboard-shortcuts.mdx +++ b/docs/features/keyboard-shortcuts.mdx @@ -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 | @@ -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` |