From c252b5db169f5397f392421ea5eba614820465b0 Mon Sep 17 00:00:00 2001 From: Agus Zubiaga Date: Wed, 5 Feb 2025 11:06:12 -0300 Subject: [PATCH] Accept edit predictions with `alt-tab` in addition to `tab` (#24272) When you have an edit prediction available, you can now also accept it with `alt-tab` (or `alt-enter` on Linux) even if you don't have an LSP completions menu open. This is meant to lower the mental load when going from one mode to another. Release Notes: - N/A --- assets/keymaps/default-linux.json | 14 +++++++------- assets/keymaps/default-macos.json | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/assets/keymaps/default-linux.json b/assets/keymaps/default-linux.json index 83c716bf2b..ac4d604fee 100644 --- a/assets/keymaps/default-linux.json +++ b/assets/keymaps/default-linux.json @@ -502,6 +502,13 @@ "tab": "editor::ComposeCompletion" } }, + { + "context": "Editor && inline_completion", + "bindings": { + // Changing the modifier currently breaks accepting while you also an LSP completions menu open + "alt-enter": "editor::AcceptInlineCompletion" + } + }, { "context": "Editor && inline_completion && !showing_completions", "use_key_equivalents": true, @@ -509,13 +516,6 @@ "tab": "editor::AcceptInlineCompletion" } }, - { - "context": "Editor && inline_completion && showing_completions", - "bindings": { - // Currently, changing this binding breaks the preview behavior - "alt-enter": "editor::AcceptInlineCompletion" - } - }, { "context": "Editor && showing_code_actions", "bindings": { diff --git a/assets/keymaps/default-macos.json b/assets/keymaps/default-macos.json index 934373b675..e865bc14ad 100644 --- a/assets/keymaps/default-macos.json +++ b/assets/keymaps/default-macos.json @@ -579,6 +579,13 @@ "tab": "editor::ComposeCompletion" } }, + { + "context": "Editor && inline_completion", + "bindings": { + // Changing the modifier currently breaks accepting while you also an LSP completions menu open + "alt-tab": "editor::AcceptInlineCompletion" + } + }, { "context": "Editor && inline_completion && !showing_completions", "use_key_equivalents": true, @@ -586,13 +593,6 @@ "tab": "editor::AcceptInlineCompletion" } }, - { - "context": "Editor && inline_completion && showing_completions", - "bindings": { - // Currently, changing this binding breaks the preview behavior - "alt-tab": "editor::AcceptInlineCompletion" - } - }, { "context": "Editor && showing_code_actions", "use_key_equivalents": true,