From eafad7d9db9dead3561e19070ff71a93f26f602a 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 | 12 ++++++------ assets/keymaps/default-macos.json | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/assets/keymaps/default-linux.json b/assets/keymaps/default-linux.json index 90c8faaadf1006fd605bbd336ed9aac7d12bb3da..676af995318a68e968573d03c78d55e4d92d2ac8 100644 --- a/assets/keymaps/default-linux.json +++ b/assets/keymaps/default-linux.json @@ -503,17 +503,17 @@ } }, { - "context": "Editor && inline_completion && !showing_completions", - "use_key_equivalents": true, + "context": "Editor && inline_completion", "bindings": { - "tab": "editor::AcceptInlineCompletion" + // Changing the modifier currently breaks accepting while you also an LSP completions menu open + "alt-enter": "editor::AcceptInlineCompletion" } }, { - "context": "Editor && inline_completion && showing_completions", + "context": "Editor && inline_completion && !showing_completions", + "use_key_equivalents": true, "bindings": { - // Currently, changing this binding breaks the preview behavior - "alt-enter": "editor::AcceptInlineCompletion" + "tab": "editor::AcceptInlineCompletion" } }, { diff --git a/assets/keymaps/default-macos.json b/assets/keymaps/default-macos.json index 934373b675727104875fa6ddaeb67ff98e053d21..e865bc14ad44caddd559cd8b2778e329520e3a9a 100644 --- a/assets/keymaps/default-macos.json +++ b/assets/keymaps/default-macos.json @@ -580,17 +580,17 @@ } }, { - "context": "Editor && inline_completion && !showing_completions", - "use_key_equivalents": true, + "context": "Editor && inline_completion", "bindings": { - "tab": "editor::AcceptInlineCompletion" + // Changing the modifier currently breaks accepting while you also an LSP completions menu open + "alt-tab": "editor::AcceptInlineCompletion" } }, { - "context": "Editor && inline_completion && showing_completions", + "context": "Editor && inline_completion && !showing_completions", + "use_key_equivalents": true, "bindings": { - // Currently, changing this binding breaks the preview behavior - "alt-tab": "editor::AcceptInlineCompletion" + "tab": "editor::AcceptInlineCompletion" } }, {