Hugo live reload issue with Helix backup (.bck) files #11715
-
SuggestionCan an option be added to disable backup files and modify the files directly when saving changes with the Current BehaviorThe current behavior can be tested by invoking Output from
tl;dr: Helix reads I'm not sure why Helix need to do this and the code doesn't help me either: helix/helix-view/src/document.rs Lines 940 to 970 in 84fbadb Use CaseMany tools that monitor a set of files/directories for changes and does something when files are created/changed/removed and don't produce the intended behavior since they get multiple events ( Such tools include This is output from
And as a result it doesn't update the generated files properly. With the new option the output should be:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
It's inktify 101 that you need to properly track files and can't just assume that files will be modified woth a single read. Editors like vim do that for example. It's the only way to avoid corrupting files if the editor crashes. If these tools don't properly account for these schemes then their file watcher implementation is broken |
Beta Was this translation helpful? Give feedback.
-
@pascalkuthe I have experienced the problem with Hugo and Helix myself, and confirmed it does not happen when using Vim. Do you know why this could be? Here is the issue in Hugo, @bep is the Hugo maintainer: gohugoio/hugo#12677 (comment) |
Beta Was this translation helpful? Give feedback.
-
I added a fix to Hugo: gohugoio/hugo#12856 EDIT: It was merged, should be fixed, please report if there are any more problems! |
Beta Was this translation helpful? Give feedback.
-
@David-Else Thank you! I'll try compiling Hugo later and test it, but the patch should suffice. As the bug was on Hugo's end, as @pascalkuthe said, I'll rename the discussion to reflect that so anyone with the same issue can just search for Hugo and upgrade to latest version with the patch. |
Beta Was this translation helpful? Give feedback.
I added a fix to Hugo: gohugoio/hugo#12856
EDIT: It was merged, should be fixed, please report if there are any more problems!