Improves the new `Editor::DuplicateSelection` @CharlesChen0823 added in https://github.com/zed-industries/zed/pull/21154. - Merge `duplicate_selection` and `duplicate_line` into single function. - Add keyboard shortcuts to JetBrains and SublimeText keymaps. - If the selection is empty (e.g. just a cursor) make `Editor::DuplicateSelection` fallback to being the same as `Editor::DuplicateLineDown`. - Tested with multiple cursors and for multiple selections. | Editor | Action | macOS | Linux | | ----------- | ------------------- | ----------- | ------------ | | VSCode | Duplicate Selection | | | | JetBrains | Duplicate Selection | cmd-d | ctrl-d | | XCode | Duplicate | cmd-d | N/A | | SublimeText | duplicate_line | cmd-shift-d | ctrl-shift-d | This matches behavior of the `duplicate` functionality in all other major editors, with one exception: other editors change the selection so that the newly duplicated object, current Zed behavior leaves the original selection unchanged (TODO?)
2.0 KiB
2.0 KiB