Add support for automatic reloading the config when it has been changed (based on #50)#69
Add support for automatic reloading the config when it has been changed (based on #50)#69marcusramberg wants to merge 2 commits intomuesli:masterfrom
Conversation
muesli
left a comment
There was a problem hiding this comment.
Thanks for cleaning this up! Left a few more remarks.
|
A general note: file watching is difficult and I fear there's a bit more work required to make this work universally. Depending on the editor you use to edit a Solving this is tricky: you'll have to watch the entire directory the |
I'm not sure which editors this would be a problem for, only been testing on nvim and it seems to work very consistently. Did a test autoincrementing a number 250 times (mostly to check that we're not leaking on reload), and seemed to reload consistently every time. An idea to address this issue could be adding a small delay (50-100ms?) (incremented every new event) before saving? |
256213a to
317c797
Compare
… be closed on deck change
317c797 to
e035729
Compare
|
I guess there's no interest in progressing this PR so I will just close it. |
|
Yeah, to be honest I'm not sure it's worth properly solving this. It would require a bunch of nasty code with tons of (platform and filesystem specific) edge-cases. Thanks for looking into it, tho! |
Automatic reloading is very useful, and I've been using it locally, but #50 seems to be abandoned, so I forked it and tried to address the remaining review comments.