Make edit prediction bindings backwards compatible with existing user keymaps (#24802)

Release Notes:

- N/A

---------

Co-authored-by: Antonio <antonio@zed.dev>
This commit is contained in:
Agus Zubiaga
2025-02-13 14:22:08 +00:00
committed by GitHub
co-authored by Antonio
parent d57f5937d4
commit c3afeda80b
8 changed files with 185 additions and 106 deletions
+4 -3
View File
@@ -510,13 +510,14 @@
"context": "Editor && edit_prediction",
"bindings": {
"alt-tab": "editor::AcceptEditPrediction",
"alt-l": "editor::AcceptEditPrediction"
"alt-l": "editor::AcceptEditPrediction",
"tab": "editor::AcceptEditPrediction"
}
},
{
"context": "Editor && edit_prediction && !edit_prediction_requires_modifier",
"context": "Editor && edit_prediction_conflict",
"bindings": {
"tab": "editor::AcceptEditPrediction",
"alt-tab": "editor::AcceptEditPrediction",
"alt-l": "editor::AcceptEditPrediction"
}
},
+4 -3
View File
@@ -583,14 +583,15 @@
{
"context": "Editor && edit_prediction",
"bindings": {
"alt-tab": "editor::AcceptEditPrediction"
"alt-tab": "editor::AcceptEditPrediction",
"tab": "editor::AcceptEditPrediction"
}
},
{
"context": "Editor && edit_prediction && !edit_prediction_requires_modifier",
"context": "Editor && edit_prediction_conflict",
"use_key_equivalents": true,
"bindings": {
"tab": "editor::AcceptEditPrediction"
"alt-tab": "editor::AcceptEditPrediction"
}
},
{
+2 -2
View File
@@ -696,7 +696,7 @@
}
},
{
"context": "Editor && edit_prediction && !edit_prediction_requires_modifier",
"context": "Editor && edit_prediction",
"bindings": {
// This is identical to the binding in the base keymap, but the vim bindings above to
// "vim::Tab" shadow it, so it needs to be bound again.
@@ -704,7 +704,7 @@
}
},
{
"context": "os != macos && Editor && edit_prediction",
"context": "os != macos && Editor && edit_prediction_conflict",
"bindings": {
// alt-l is provided as an alternative to tab/alt-tab. and will be displayed in the UI. This
// is because alt-tab may not be available, as it is often used for window switching on Linux