1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00

fix(repl): use spaces for tab handler on windows (#14931)

There is a bug in rustyline with tabs on Windows, so we insert spaces for now.
This commit is contained in:
sigmaSd 2022-06-22 15:28:28 +01:00 committed by GitHub
parent 3455f16079
commit efaa149819
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -423,7 +423,13 @@ impl ConditionalEventHandler for TabEventHandler {
.filter(|c| c.is_whitespace())
.is_some()
{
if cfg!(target_os = "windows") {
// Inserting a tab is broken in windows with rustyline
// use 4 spaces as a workaround for now
Some(Cmd::Insert(n, " ".into()))
} else {
Some(Cmd::Insert(n, "\t".into()))
}
} else {
None // default complete
}