Skip to content

Commit 75b13f4

Browse files
committed
generalise spinLoadingSpinnerOnce for any coord
1 parent a17e2de commit 75b13f4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/ui/menuui.nim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,10 @@ proc exit*(ctx: ptr Handle, isPaused: bool) =
334334
showExitMessage()
335335
quit(QuitSuccess)
336336

337-
proc spinLoadingSpinnerOnce*(frame: var int) =
337+
proc spinLoadingSpinnerOnce*(frame: var int, coord = (-1, -1)) =
338338
const spinner = @["-", "\\", "|", "/"]
339-
setCursorPos(termWidth-3, 2)
339+
if coord == (-1, -1): setCursorPos(termWidth - 3, 2)
340+
else: setCursorPos(coord[0], coord[1])
340341
stdout.write("[" & spinner[frame] & "]")
341342
stdout.flushFile()
342343
if frame == 3: frame = 0

0 commit comments

Comments
 (0)