Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Add: Live preview on Linux now detects files saved via atomic write (write-to-temp then rename), so changes from AI agents are picked up reliably
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ private void register(Path path) {
return;
}

final WatchKey key = path.register(watchService, new WatchEvent.Kind[]{StandardWatchEventKinds.ENTRY_MODIFY},
// ENTRY_CREATE is required to handle swap in atomic writes
final WatchKey key = path.register(watchService,
new WatchEvent.Kind[]{StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_MODIFY},
SensitivityWatchEventModifier.HIGH);
pathByKey.put(key, path);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ private void onMarkupChange(Path path) {

private void onDependentChange(Path path) {
execute(() -> {
String pathAsString = path.toString();
if (pathAsString.contains(".md.tmp.") || pathAsString.endsWith(".md.tmp")) {
return;
}

Collection<TocItem> dependentTocItems = previewWebSite.dependentTocItems(path);
if (dependentTocItems.isEmpty()) {
ConsoleOutputs.out("no markup files depends on ", BLUE, path);
Expand Down
Loading