added prettyness to bookmarks

This commit is contained in:
Paul Wilde 2022-10-21 17:19:22 +01:00
parent 3b8dd53771
commit 582bc2795f

View file

@ -34,9 +34,8 @@ proc getTitle(bookmark: Bookmark): Future[string] {.async.} =
return "" return ""
proc save(bookmarks: seq[Bookmark]): bool {.discardable.} = proc save(bookmarks: seq[Bookmark]): bool {.discardable.} =
let file = open(bookmarks_file, fm_write) let data = pretty(%*bookmarks)
defer: file.close() writeFile(bookmarks_file, data)
file.write($$bookmarks)
proc get(bookmarks: seq[Bookmark], str: string): Bookmark = proc get(bookmarks: seq[Bookmark], str: string): Bookmark =
for bookmark in bookmarks: for bookmark in bookmarks: