fix nim secret dots interfering with prompt (#16491)

* fix nim secret dots

* cleanups
This commit is contained in:
Timothee Cour 2020-12-28 03:19:47 -08:00 • committed by GitHub
commit f9a15dbae9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 4 deletions

View file

@ -19,9 +19,9 @@ template instLoc(): InstantiationInfo = instantiationInfo(-2, fullPaths = true)
template toStdOrrKind(stdOrr): untyped =
if stdOrr == stdout: stdOrrStdout else: stdOrrStderr
template flushDot(conf, stdOrr) =
template flushDot*(conf, stdOrr) =
## safe to call multiple times
let stdOrrKind = stdOrr.toStdOrrKind()
let stdOrrKind = toStdOrrKind(stdOrr)
if stdOrrKind in conf.lastMsgWasDot:
conf.lastMsgWasDot.excl stdOrrKind
write(stdOrr, "\n")