silverbullet
silverbullet copied to clipboard
Lock mode when editing
Since the last updates, I love the option of not using the PWA, it is much faster. But I have found a problem when you are editing a note. In my case I have the notes mounted with rclone on the local but this could be the case if you are editing simultaneously with another editor, Since Silverbullet does not write changes to the markdown file until you have finished typing the word or phrase, if a synchronization occurs on the server, the server version prevails and In the middle of a sentence, what you had already written is deleted. It would be great if when you are editing a note, everything you are writing takes precedence over the real-time changes of the note, Or at least that it prevails for a few seconds until you can finish writing the phrase and that it does not eliminate what was written. And something equivalent to what some editors have, which is a pinned mode where everything you are writing prevails while you have the note open.
It could be adding an option that locks the note by default as long as it remains open with silverbullet. If changes occur to the note while you are editing with silverbullet, this option allows it not to be modified in silverbullet or the real-time refresh is slower . And when you leave the note, save the note as it is being viewed in silverbullet and write if there is a change with another editor, the changes made in silverbullet prevail
The idea of locking a file has been in my mind for some time, also to potentially have some sort of way of supporting multiple users editing or at least looking at the same page without overriding each other.
When you say "editing with another editor" you mean something else than SB, right? I'm just thinking how we would encode a file being locked? I think Unix systems have a file locking mechanism, but I have no idea if what works rclone (never heard of this tool). Potentially we could introduce a SB specific lock file that indicates some other client is currently editing a file, but then any other (non-SB) editor would have to understand and respect such a file.
Yeah. If there is another editor, other than Silverbullet. Even saving the file that is open in silverbullet with another editor, when you exit Silverbullet editing mode, save what you see in Silverbullet in the file, in this way even if another editor has modified the file and saved, when exiting silverbullet it will overwrite it. In this way, the silverbullet version will be above the rest of the editors, in the event that there are several editors open.
Rclone is an application developed in Go, which allows you to copy, synchronize and mount the content of multiple private and public clouds. I have my notes mounted with rclone from a cloud to local and Silverbullet accesses that directory and modifies or creates notes, which are on the remote server. https://rclone.org/
The only thing that comes to mind is that, just as there is a sync icon, there would be an icon to anchor the content of the note or notes you are editing. If you click on the icon, Silverbullet will overwrite the markdown note displayed in Silverbullet every time you edit and exit the note because everything you write in SilverBullet prevails. And if the note is modified with another editor, it will not be previewed in SilverBullet. But if you don’t anchor the note using the icon, you will have the current and multi-user refresh as it is now.
I thought that just as there is a command to enable the dark theme, there should be a command that allows you to change the icon and current synchronization mode, to the view-edit mode.
If you switch to this mode, the sync icon would change to a pencil icon and the note would be in view mode. If you click on the pencil-shaped icon, the note will allow writing.
Now in editing mode, the icon that will be in the synchronization place will be an icon with an eye, in view mode it was a pencil, which changes to an icon with an eye, Indicating that if you press this icon, it will save the current content of the note and it will change back to view mode.
This option will allow it to work with rclone and if any other editor modifies a note, the silverbullet edition will always prevail