zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.84k stars 2.8k forks source link

Reset or refresh opened file #13212

Open vito opened 3 months ago

vito commented 3 months ago

Check for existing issues

Describe the feature

(Sorry if dupe, searched pretty hard and couldn't find anything.)

Zed will notice when a file has updated out-of-band and warn me when I try to save, which is great. But how can I do the equivalent to Vim's :e! to reset to the current file's content?

Even better would be for a buffer which was initially unmodified (i.e. saved to disk) to just automatically refresh when it notices the file changed (i.e. due to a Git branch switch). It doesn't seem like that happens now. It seems like it prefers to retain the old content and deem it "modified" (state != disk) and then warns me about closing with unsaved changes. (I could be wrong here, sorry if so.) (edit: just saw this working, so not sure what gave me that impression)

Side note: I have the tab bar disabled locally for a more Vim-like experience, otherwise I end up with a million tabs duped between all my panels. So not seeing the file modification state might be a factor in my UX here.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

ConradIrwin commented 3 months ago

Thanks for reporting! Looks like we need to create an action for this, and then bind :e to do it. If you want to pair on this https://calendly.com/conradirwin/pairing

jpx40 commented 1 month ago

is there a way to trigger relaod automatic. i wanna format my file with an cli tool.

simicvm commented 3 weeks ago

any updates on this?

stuaxo commented 6 days ago

I'd like it if it noticed the file was updated out of band immediately as well.