Accept edit predictions with `alt-tab` in addition to `tab` (#24272)

Agus Zubiaga created

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

Change summary

assets/keymaps/default-linux.json | 12 ++++++------
assets/keymaps/default-macos.json | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)

Detailed changes

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"
     }
   },
   {

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"
     }
   },
   {