]> njoseph.me Git - nimcoon.git/commitdiff
Wipe screen on each redisplay of search results
authorJoseph Nuthalapati <njoseph@riseup.net>
Thu, 20 Feb 2020 20:38:00 +0000 (02:08 +0530)
committerJoseph Nuthalapati <njoseph@riseup.net>
Thu, 20 Feb 2020 20:38:00 +0000 (02:08 +0530)
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
src/lib.nim

index 53c2e5d5a98bbde84372d82a0f4f7dd62a21c459..c737f0242ef157c4d6560865f2979a1a201e24a1 100644 (file)
@@ -40,7 +40,7 @@ func extractTitlesAndUrls*(html: string): seq[SearchResult] =
       map(a => (a.attrs["title"], "https://www.youtube.com" & a.attrs["href"]))
 
 proc presentVideoOptions*(searchResults: seq[SearchResult]) =
-  echo ""
+  eraseScreen()
   for index, (title, url) in searchResults:
     styledEcho $index, ". ", styleBright, fgMagenta, title, "\n", resetStyle, fgCyan, url, "\n"