vrtmrz / obsidian-livesync

MIT License
3.96k stars 134 forks source link

Option "Sync on save" to only trigger on manual save #284

Open Kageetai opened 10 months ago

Kageetai commented 10 months ago

More of a question or feature request, than an issue:

Abstract

When enabling the option "Sync on save" on my mobile device, syncing happens every few seconds when Obsidian saves the document, even while typing. I was wondering whether it was possible to trigger syncing only when manually saving, not on the "automatic saving". The Obsidian Linter plugin has a similar option, where linting only happens when triggering a "manual save" (or pressing Ctrl+S).

Expected behaviour

Another option in the settings to only "sync on manual save" would be nice.

vrtmrz commented 9 months ago

Thank you for your brilliant idea! I did not know this but actually, it is so useful! I have implemented this at v0.19.20. However, if multiple plugins hook this command, this plug-in is possibly ignored. (If this plug-in has been loaded after other plug-ins loaded, this plug-in calls the logic which was set previously after triggering the replication, but I am worried about when this plug-in has loaded earlier than others). May I ask you to check the behaviour, please?

Kageetai commented 9 months ago

Hey, thank you for the quick work on that, from my side it seems to work wonderfully. Both Obsidian-Linter and the sync seem to be triggered when I save manually, either via Ctrl+S or command palette. Tested it both on desktop and tablet.