zed icon indicating copy to clipboard operation
zed copied to clipboard

Can't accept partial Edit Prediction in Subtle Display Mode

Open jacorpski opened this issue 8 months ago • 5 comments

Summary

When changing Edit Prediction Display Mode it seems impossible to accept partial predictions

Steps to trigger the problem:

  1. Have the Edit Prediction Display Mode set to Eager and accept partial with ctrl-cmd-right (standard key binding)
  2. Change the Display Mode to Subtle and try to accept partial with same key combination

Actual Behavior: It seems that when the Display Mode is set to Subtle and you press alt to see the suggested code, when you press any other key, fx ctrl to do the first key of accept partial, then the suggestion disappear and you can't accept partial.

Expected Behavior: I expect that you can accept partial suggestion like you can do in Eager Display Mode

Zed Version and System Specs

Zed: v0.179.2 (Zed) OS: macOS 15.3.0 Memory: 64 GiB Architecture: aarch64

jacorpski avatar Mar 27 '25 03:03 jacorpski

ran into the same issue

pleibers avatar Apr 01 '25 13:04 pleibers

Yep, I can reproduce. The two keybinds do not work well together. Holding alt prevents one from using the cmd-ctrl-right keybind because if you release alt or press one of those keys the prediction goes away.

notpeter avatar Apr 29 '25 20:04 notpeter

This keymap doesn't seem to work for me (macOS dings, zed doesn't see the event). I would love to have a keybind which includes alt so the two can be used together.

  {
    "context": "Editor && mode == full && edit_prediction",
    "bindings": {
      "ctrl-alt-cmd-right": "editor::AcceptPartialEditPrediction"
    }
  },

notpeter avatar May 30 '25 14:05 notpeter

As written on Discord, I have tested it on my side with the keymap @notpeter has as an example, and my Zed instances see the event, however it doesn't do anything, because when I press any other key together with alt, the edit prediction disappears

Image

Not sure if the keyboard layout have anything to do with it, but as shown in my picture, my keyboard layout is Danish

jacorpski avatar May 30 '25 15:05 jacorpski

I found my conflict with ctrl-alt-cmd-right (Rectangle.app). Yes, it looks like we would need do something explicitly to the editor::AcceptPartialEditPrediction action to make it support being used in subtle mode. The above keymap is insufficient.

notpeter avatar May 30 '25 16:05 notpeter

I can see there's a fix to fix the issue with not being able to accept partial when using subtle mode, however I'm not sure it's the correct solution. If I press the alt key I can see the suggested code, but when I press any key, it disappear. I can tho accept partial, but only when alt isn't pressed. I imagined I should be able to see the suggested code while accepting partially. Right now I have to see what's suggested, then release alt key and accept partially, and eventually maybe press alt key again to see if I accepted everything I wanted.

I have build from source, and that was my experience. Is that expected behavior or?

jacorpski avatar Jun 06 '25 00:06 jacorpski

@jacorpski Thanks for following up on this! Indeed it should also display it when the modifiers for AcceptPartialEditPrediction are held, and #32212 adds that.

mgsloan avatar Jun 06 '25 06:06 mgsloan