-
Notifications
You must be signed in to change notification settings - Fork 749
Description
Description
Marimo blocks autosave when running with --watch, see
For our UC it would be helpful to have the option to enable both watch and autosave.
We use watch to detect external changes from git operations like branching. For changes coming from marimo like autosave, git will pick that up as an unstaged diff.
You could argue that it's on the other application (editor or otherwise) to handle potentially conflicting writes coming from your autosave functionality. Most editors are pretty good about warning when a file has changed externally.
Seems like something that should be possible, with the appropriate warnings and caveats.
Suggested solution
Could be as easy as removing the config override here and turning the info into a warning.
marimo/marimo/_server/start.py
Lines 199 to 211 in 64225b3
| # If watch is true, disable auto-save and format-on-save, | |
| # watch is enabled when they are editing in another editor | |
| if watch: | |
| config_reader = config_reader.with_overrides( | |
| { | |
| "save": { | |
| "autosave": "off", | |
| "format_on_save": False, | |
| "autosave_delay": 1000, | |
| } | |
| } | |
| ) | |
| LOGGER.info("Watch mode enabled, auto-save is disabled") |
The GUI and the docs should probably warn that running watch and autosave together can cause problems.
Are you willing to submit a PR?
- Yes
Alternatives
Is it possible to yoke the watch and autosave hooks so autosave only runs after a watch update?
Additional context
No response