mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -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())
|
.filter(|c| c.is_whitespace())
|
||||||
.is_some()
|
.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 {
|
} else {
|
||||||
None // default complete
|
None // default complete
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue