mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 04:45:04 +02:00
Add NU config to allow user be able to turn off external completion (#5773)
* 06-07-wsl * 06-07-linux-issue-with-delete-input * 06-08-2023 * 06-08-Linux * commit for merge * Fix unit test * format * clean code * Add flag to turn off external completion * change env var to config * Fix comment Co-authored-by: Frank Zhang <v-frankz@microsoft.com>
This commit is contained in:
@ -199,12 +199,19 @@ impl Completer for CommandCompletion {
|
||||
return subcommands;
|
||||
}
|
||||
|
||||
let config = working_set.get_config();
|
||||
let commands = if matches!(self.flat_shape, nu_parser::FlatShape::External)
|
||||
|| matches!(self.flat_shape, nu_parser::FlatShape::InternalCall)
|
||||
|| ((span.end - span.start) == 0)
|
||||
{
|
||||
// we're in a gap or at a command
|
||||
self.complete_commands(working_set, span, offset, true, options.match_algorithm)
|
||||
self.complete_commands(
|
||||
working_set,
|
||||
span,
|
||||
offset,
|
||||
config.enable_external_completion,
|
||||
options.match_algorithm,
|
||||
)
|
||||
} else {
|
||||
vec![]
|
||||
};
|
||||
|
Reference in New Issue
Block a user