mirror of
https://github.com/denoland/deno.git
synced 2024-12-25 16:49:18 -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:
parent
3455f16079
commit
efaa149819
1 changed files with 7 additions and 1 deletions
|
@ -423,7 +423,13 @@ impl ConditionalEventHandler for TabEventHandler {
|
|||
.filter(|c| c.is_whitespace())
|
||||
.is_some()
|
||||
{
|
||||
Some(Cmd::Insert(n, "\t".into()))
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue