Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable nimExperimentalLinenoiseExtra #24227

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/wrappers/linenoise/linenoise.nim
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ proc printKeyCodes*() {.importc: "linenoisePrintKeyCodes".}

proc free*(s: cstring) {.importc: "free", header: "<stdlib.h>".}

when defined(nimExperimentalLinenoiseExtra) and not defined(windows):
when not defined(windows):
# C interface
type LinenoiseStatus = enum
linenoiseStatus_ctrl_unknown
Expand All @@ -58,7 +58,7 @@ when defined(nimExperimentalLinenoiseExtra) and not defined(windows):
## line editing API that allows returning the line entered and an indicator
## of which control key was entered, allowing user to distinguish between
## for example ctrl-C vs ctrl-D.
runnableExamples("-d:nimExperimentalLinenoiseExtra -r:off"):
runnableExamples("-r:off"):
var ret: ReadLineResult
while true:
readLineStatus("name: ", ret) # ctrl-D will exit, ctrl-C will go to next prompt
Expand Down
3 changes: 0 additions & 3 deletions tests/config.nims
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ hint("Processing", off)
# switch("hint", "ConvFromXtoItselfNotNeeded")
# switch("warningAsError", "InheritFromException") # would require fixing a few tests

# experimental APIs are enabled in testament, refs https://github.com/timotheecour/Nim/issues/575
# sync with `kochdocs.docDefines` or refactor.
switch("define", "nimExperimentalLinenoiseExtra")

# preview APIs are expected to be the new default in upcoming versions
switch("define", "nimPreviewFloatRoundtrip")
Expand Down
2 changes: 1 addition & 1 deletion tools/kochdocs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const
paCode* = " --doc.plausibleAnalytics:nim-lang.org"
# errormax: subsequent errors are probably consequences of 1st one; a simple
# bug could cause unlimited number of errors otherwise, hard to debug in CI.
docDefines = "-d:nimExperimentalLinenoiseExtra"
docDefines = "-d:nimExperimentalLinenoiseExtra" # deadcode `nimExperimentalLinenoiseExtra` has been enabled
nimArgs = "--errormax:3 --hint:Conf:off --hint:Path:off --hint:Processing:off --hint:XDeclaredButNotUsed:off --warning:UnusedImport:off -d:boot --putenv:nimversion=$# $#" % [system.NimVersion, docDefines]
gitUrl = "https://github.com/nim-lang/Nim"
docHtmlOutput = "doc/html"
Expand Down
Loading