From 582bc2795f72adda7919cc7111f4ec4541ad651e Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Fri, 21 Oct 2022 17:19:22 +0100 Subject: [PATCH] added prettyness to bookmarks --- burrkmarks/src/burrkmarks.nim | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/burrkmarks/src/burrkmarks.nim b/burrkmarks/src/burrkmarks.nim index c136f7e..b51d3d1 100644 --- a/burrkmarks/src/burrkmarks.nim +++ b/burrkmarks/src/burrkmarks.nim @@ -34,9 +34,8 @@ proc getTitle(bookmark: Bookmark): Future[string] {.async.} = return "" proc save(bookmarks: seq[Bookmark]): bool {.discardable.} = - let file = open(bookmarks_file, fm_write) - defer: file.close() - file.write($$bookmarks) + let data = pretty(%*bookmarks) + writeFile(bookmarks_file, data) proc get(bookmarks: seq[Bookmark], str: string): Bookmark = for bookmark in bookmarks: