-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
edit prediction: Don't show and discard completion if toggled off in the buffer #24927
edit prediction: Don't show and discard completion if toggled off in the buffer #24927
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@danilo-leal hmm, that is the binding I have set. Maybe I'm doing something wrong? Here's a video to better illustrate (for clarity: my key presses are shown in the black overlay): zed.mov
ie: I feel like there's an asymmetry in when the edit prediction is refreshed. When toggling off, it doesn't go away without a text update. With toggling on, it appears immediately. I feel like the desired behaviour should be when toggling off, any visible edit prediction should immediately disappear. |
Uhm... that makes sense, yeah, thanks for the clarification! Tagging @agu-z for an additional pair of eyes on the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks for your contribution 🥳
Thanks both! @danilo-leal the other thing I wanted to suggest was persisting the user's last setting for "Show Edit Predictions for this buffer". At least, when I restart Zed my preference is forgotten. I think it's also reset while using Zed (maybe switching between files? can't quite remember). Would this be sensible to do, do you think? (or indeed, is it already currently supported?) |
@itsaphel that's indeed a non-persistent setting; I mean, it will persist in a buffer that you don't close, but once you do and re-open it again, it should reset to the default. We've gone back and forth as far as supporting the persistence, and the last place we got to was that it wasn't worth it because if you want to persistently not have edit predictions for a single file, you can use the |
@danilo-leal hmm, so for a bit of context, my workflow is roughly as follows: Sometimes I switch to a bit of work for which edit predictions are distracting and/or poor. eg: writing comments, documentation, etc -- for these, the "This Buffer" option would work pretty well. Other examples are writing more complicated bits of logic, or just wanting to think through something myself without hints, and this taask spans across files. In JetBrains IDEs, I've quite liked how Copilot's toggle works. It's a global, persistent "Enable/Disable Completions" option. I think the equivalent in Zed is |
Sweet, appreciate you clarifying it! Yeah, the "All Files" option is persistent and global (i.e., regardless of buffer, window, or language). So I think reaching for that is what you want! And having a keybinding is a great idea—we should do that. |
Discards an inline completion when it's toggled to off (using, say, a keyboard shortcut). This matches the behaviour in VS Code and JetBrains, and I think is a bit more intuitive.
(#24895)
Release Notes: