FIX REPL tab at beginning of line should indent not complete (#2125)

This commit is contained in:
Liumeo 2022-01-23 20:50:08 -05:00 committed by GitHub
parent 8323987b39
commit 50938f3797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -36,6 +36,9 @@ substitutions:
improved with some context information.
{pr}`2121`
- {{Enhancement}} Pressing TAB in REPL no longer triggers completion when input
is whitespace. {pr}`2125`
## Version 0.19.0
_January 10, 2021_

View File

@ -133,6 +133,15 @@
term.set_command("");
term.set_prompt(ps1);
},
"TAB": (event, original) => {
const command = term.before_cursor();
// Disable completion for whitespaces.
if (command.trim() === "") {
term.insert("\t");
return false;
}
return original(event);
}
},
});
window.term = term;