add darwin support
This commit is contained in:
parent
73904c036f
commit
4a7febee6c
10 changed files with 774 additions and 47 deletions
|
|
@ -37,6 +37,18 @@ let inshellah_limit_args = { |flag|
|
|||
if $inshellah_dynamic_limit == 0 { [] } else { [$flag $inshellah_dynamic_limit] }
|
||||
}
|
||||
|
||||
# nushell's own cap on how many external completions it will display.
|
||||
# mirrors the Rust completer's INSHELLAH_MAX_COMPLETIONS cap so both ends
|
||||
# agree. 0 (or unset) keeps the historical default of 200.
|
||||
let inshellah_default_max_results = 200
|
||||
|
||||
let inshellah_max_results = do {
|
||||
let raw = (try {
|
||||
$env.INSHELLAH_MAX_COMPLETIONS? | default 0 | into int
|
||||
} catch { 0 })
|
||||
if $raw > 0 { $raw } else { $inshellah_default_max_results }
|
||||
}
|
||||
|
||||
let inshellah_with_timeout = { |body|
|
||||
if $inshellah_dynamic_timeout_ms == 0 {
|
||||
try { do $body } catch { null }
|
||||
|
|
@ -853,4 +865,4 @@ let inshellah_complete = { |spans|
|
|||
}
|
||||
}
|
||||
|
||||
$env.config.completions.external = {enable: true, max_results: 200, completer: $inshellah_complete}
|
||||
$env.config.completions.external = {enable: true, max_results: $inshellah_max_results, completer: $inshellah_complete}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue