subfolder support

This commit is contained in:
randogoth 2025-02-22 15:45:04 +02:00
parent a7f2e1ca89
commit f77a66d5d8
2 changed files with 208 additions and 65 deletions

View file

@ -58,8 +58,10 @@ class _NoteEditorScreenState extends State<NoteEditorScreen> {
try {
final notesDirectory = widget.notesDirectoryPath ??
widget.note.parent.path; // Use correct directory
final newFilePath =
path.join(notesDirectory, widget.note.uri.pathSegments.last);
// Get the full path of the original file, preserving subfolder structure
final relativeNotePath = path.relative(widget.note.path, from: notesDirectory);
final newFilePath = path.join(notesDirectory, relativeNotePath); // Preserve subfolder
print("📝 Attempting to save note at: $newFilePath");
final newFile = File(newFilePath);