excalidraw / excalidraw-vscode

Excalidraw for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=pomdtr.excalidraw-editor
MIT License
457 stars 55 forks source link

Autosave for just .excalidraw files #1

Closed Milo123459 closed 3 years ago

Milo123459 commented 3 years ago

Hi!

This extension is litreally a life saver, thanks so much!

Maybe, a suggestion, a way to toggle on autosave just for .excalidraw files? Like, when you draw a new component, resize something, etc, it auto saves.

Thanks!

Milo123459 commented 3 years ago

^ Also, please bump the excalidraw package to 0.7.0

pomdtr commented 3 years ago

I think you can get this feature by using the files.autoSave setting. Mine is set to: onFocusChange.

Milo123459 commented 3 years ago

Would this work for just 1 type of file though?

pomdtr commented 3 years ago

Sadly no :/ -> This setting does not support per-language configuration.

Milo123459 commented 3 years ago

Sad :(

Do you know if it is possible to write autosave into the extension just for the .excalidraw files?

pomdtr commented 3 years ago

Yes it is pretty easy to achieve. I had it in a previous version, but it did feel like an hack (the dirty indicator was blinking on file change), so I removed it.

Milo123459 commented 3 years ago

Yes it is pretty easy to achieve. I had it in a previous version, but it did feel like an hack (the dirty indicator was blinking on file change), so I removed it.

Oh, I think maybe make it configurable, would be so helpful. Maybe also open an issue on microsoft/vscode asking about how you do it? (Removing the top left unsaved files count going from 1 to 0)

pomdtr commented 3 years ago

I think the issue can be resolved by directly writing to the file instead of creating a workspace edit.

Milo123459 commented 3 years ago

I think the issue can be resolved by directly writing to the file instead of creating a workspace edit.

Yes, that'd work!

pomdtr commented 3 years ago

fixed in 8110d4f3908bd9a29d8c7ae7de109b6f05150866