diff --git a/benchmarks/gradient-autoview.nu b/benchmarks/gradient-autoview.nu index c410526..ac4807e 100644 --- a/benchmarks/gradient-autoview.nu +++ b/benchmarks/gradient-autoview.nu @@ -16,5 +16,5 @@ seq 0 $height | par-each {|| # create these in parallel } } | str join) print -n $"($row_data)" | table - $nothing + null } | compact diff --git a/custom-completions/auto-generate/parse-fish.nu b/custom-completions/auto-generate/parse-fish.nu index f32be00..7a0a828 100644 --- a/custom-completions/auto-generate/parse-fish.nu +++ b/custom-completions/auto-generate/parse-fish.nu @@ -27,7 +27,7 @@ def parse-fish [] { | flatten # merge them all into a top level label ) # default every column in the table to "" to make processing easier - # some values having $nothing often breaks nu or requires lots of checking + # some values having null often breaks nu or requires lots of checking $data | columns | reduce -f $data { |c, acc| $acc | default "" $c } diff --git a/custom-completions/winget/winget-completions.nu b/custom-completions/winget/winget-completions.nu index f021cce..c819823 100644 --- a/custom-completions/winget/winget-completions.nu +++ b/custom-completions/winget/winget-completions.nu @@ -374,7 +374,7 @@ def "nu-complete winget source type" [] { def "nu-complete winget flagify" [name: string, value: any, --short(-s): bool] { let flag_start = if $short { '-' } else { '--' } - if $value == $nothing or $value == false { + if $value == null or $value == false { "" } else if $value == true { $"($flag_start)($name)" diff --git a/hooks/direnv/direnv.nu b/hooks/direnv/direnv.nu index 61e9e89..8f92714 100644 --- a/hooks/direnv/direnv.nu +++ b/hooks/direnv/direnv.nu @@ -23,7 +23,7 @@ export-env { $env.config = ( $env.config | upsert hooks.env_change.PWD { |config| let o = ($config | get -i hooks.env_change.PWD) let val = (direnv) - if $o == $nothing { + if $o == null { $val } else { $o | append $val diff --git a/hooks/dynamic-load/dynamic-load.nu b/hooks/dynamic-load/dynamic-load.nu index c446926..6a2abfe 100644 --- a/hooks/dynamic-load/dynamic-load.nu +++ b/hooks/dynamic-load/dynamic-load.nu @@ -11,7 +11,7 @@ export-env { $env.config = ( $env.config | upsert hooks.env_change.PWD { |config| let o = ($config | get -i hooks.env_change.PWD) let val = (dynamic_load) - if $o == $nothing { + if $o == null { $val } else { $o | append $val diff --git a/hooks/filesystem/autojump.nu b/hooks/filesystem/autojump.nu index d499b97..afaa9d6 100644 --- a/hooks/filesystem/autojump.nu +++ b/hooks/filesystem/autojump.nu @@ -21,7 +21,7 @@ def-env j [dir] { $env.config = ($env.config | upsert hooks.env_change.PWD {|config| let val = ($config | get -i hooks.env_change.PWD) - if $val == $nothing { + if $val == null { $val | append {|before, after| autojump_add_to_database $after } } else { [ diff --git a/make_release/gen-js-ext.nu b/make_release/gen-js-ext.nu index eb4fa30..1c0d6ef 100644 --- a/make_release/gen-js-ext.nu +++ b/make_release/gen-js-ext.nu @@ -55,7 +55,7 @@ def gen_keywords_alphabetically [] { if ($cmd | str starts-with $alpha) { $cmd } else { - $nothing + null } } | str join '|') if ($letter_cmds | str trim | str length) > 0 { @@ -87,7 +87,7 @@ def gen_sub_keywords_alphabetically [] { let parts = ($cmd | split row ' ') $'($parts.0)\\s($parts.1)' } else { - $nothing + null } } | str join '|') if ($letter_cmds | str trim | str length) > 0 { diff --git a/modules/nvim/nvim.nu b/modules/nvim/nvim.nu index f8b9c16..44964d3 100644 --- a/modules/nvim/nvim.nu +++ b/modules/nvim/nvim.nu @@ -43,7 +43,7 @@ export-env { $env.config = ( $env.config | upsert hooks.env_change.PWD { |config| let o = ($config | get -i hooks.env_change.PWD) let val = (nvim_tcd) - if $o == $nothing { + if $o == null { $val } else { $o | append $val diff --git a/modules/prompt/async_git_prompt/prompt.nu b/modules/prompt/async_git_prompt/prompt.nu index 379d8a9..043576d 100644 --- a/modules/prompt/async_git_prompt/prompt.nu +++ b/modules/prompt/async_git_prompt/prompt.nu @@ -23,7 +23,7 @@ def prompt-create-left-prompt [] { } def prompt-create-right-prompt [] { - $nothing + null } $env.PROMPT_COMMAND = { prompt-create-left-prompt } diff --git a/modules/prompt/oh-my-minimal.nu b/modules/prompt/oh-my-minimal.nu index 3065b5d..aef3554 100644 --- a/modules/prompt/oh-my-minimal.nu +++ b/modules/prompt/oh-my-minimal.nu @@ -260,7 +260,7 @@ export def get_right_prompt [os use_nerd_fonts] { } export def get_prompt [nerd?] { - let use_nerd_fonts = ($nerd != $nothing) + let use_nerd_fonts = ($nerd != null) let os = ((sys).host.name) let left_prompt = (get_left_prompt $os $use_nerd_fonts) let right_prompt = (get_right_prompt $os $use_nerd_fonts) diff --git a/modules/prompt/oh-my-v2.nu b/modules/prompt/oh-my-v2.nu index 2f2e887..ceb4245 100644 --- a/modules/prompt/oh-my-v2.nu +++ b/modules/prompt/oh-my-v2.nu @@ -168,12 +168,12 @@ let runtime_colors = [ { name: prompt_color_separator_same_color, '8bit': $prompt_color_separator_same_color_8, '24bit': $prompt_color_separator_same_color_24 }, { name: left_separator_diff_color, '8bit': $left_prompt_separator_diff_color, '24bit': $left_prompt_separator_diff_color }, { name: left_separator_same_color, '8bit': $left_prompt_separator_same_color, '24bit': $left_prompt_separator_same_color }, - { name: left_prefix, value: $nothing }, - { name: left_suffix, value: $nothing }, + { name: left_prefix, value: null }, + { name: left_suffix, value: null }, { name: right_separator_diff_color, '8bit': $right_prompt_separator_diff_color, '24bit': $right_prompt_separator_diff_color }, { name: right_separator_same_color, '8bit': $right_prompt_separator_same_color, '24bit': $right_prompt_separator_same_color }, - { name: right_prefix, value: $nothing }, - { name: right_suffix, value: $nothing }, + { name: right_prefix, value: null }, + { name: right_suffix, value: null }, { name: cmd_bg_color, '8bit': $cmd_duration_bg_color_8, '24bit': $cmd_duration_bg_color_24 }, { name: cmd_color, '8bit': $cmd_duration_color_8, '24bit': $cmd_duration_color_24 }, @@ -199,9 +199,9 @@ let runtime_colors = [ { name: pwd_color_anchors, '8bit': $pwd_color_anchors_8, '24bit': $pwd_color_anchors_24 }, { name: pwd_color_dirs, '8bit': $pwd_color_dirs_8, '24bit': $pwd_color_dirs_24 }, { name: pwd_color_truncated_dirs, '8bit': $pwd_color_truncated_dirs_8, '24bit': $pwd_color_truncated_dirs_24 }, - { name: pwd_icon, value: $nothing }, - { name: pwd_icon_home, value: $nothing }, - { name: pwd_icon_unwritable, value: $nothing }, + { name: pwd_icon, value: null }, + { name: pwd_icon_home, value: null }, + { name: pwd_icon_unwritable, value: null }, { name: rustc_bg_color, '8bit': $rustc_bg_color_8, '24bit': $rustc_bg_color_24 }, { name: rustc_color, '8bit': $rustc_color_8, '24bit': $rustc_color_24 }, @@ -211,12 +211,12 @@ let runtime_colors = [ { name: status_bg_color_failure, '8bit': $status_bg_color_failure_8, '24bit': $status_bg_color_failure_24 }, { name: status_color, '8bit': $status_color_8, '24bit': $status_color_24 }, { name: status_color_failure, '8bit': $status_color_failure_8 , '24bit': $status_color_failure_24 }, - { name: status_icon, value: $nothing }, - { name: status_icon_failure, value: $nothing }, + { name: status_icon, value: null }, + { name: status_icon_failure, value: null }, { name: time_bg_color, '8bit': $time_bg_color_8, '24bit': $time_bg_color_24 }, { name: time_color, '8bit': $time_color_8, '24bit': $time_color_24 }, - { name: time_format, value: $nothing }, + { name: time_format, value: null }, { name: indicator_bg_color, '8bit': $indicator_bg_color_8, '24bit': $indicator_bg_color_24 }, { name: indicator_color, '8bit': $indicator_color_8, '24bit': $indicator_color_24 }, diff --git a/modules/prompt/powerline/README.md b/modules/prompt/powerline/README.md index c0de1cf..28c3383 100644 --- a/modules/prompt/powerline/README.md +++ b/modules/prompt/powerline/README.md @@ -12,7 +12,7 @@ use power.nu } use power_utils.nu power inject 0 1 {source: atuin, color: '#4C4B4A'} - power set time $nothing { short: false } + power set time null { short: false } power init ``` or @@ -60,7 +60,7 @@ power analyze ``` ## todo -- [x] source return `$nothing` for hiding +- [x] source return `null` for hiding - [ ] in fast mode, there is still a problem with hideable components on the left - [x] proxy stat invalid in plain mode - '<<' not longer hide separator in `fast` mode diff --git a/modules/prompt/powerline/power.nu b/modules/prompt/powerline/power.nu index 3f28774..4767281 100644 --- a/modules/prompt/powerline/power.nu +++ b/modules/prompt/powerline/power.nu @@ -55,7 +55,7 @@ export def proxy_stat [] { if not (($env.https_proxy? | is-empty) and ($env.http_proxy? | is-empty)) { [$bg ''] } else { - [$bg $nothing] + [$bg null] } } } @@ -192,7 +192,7 @@ def left_prompt [segment] { let segment = ($segment | reduce -f [] {|x, acc| let y = (do $x.1 $x.0) - if $y.1 == $nothing { + if $y.1 == null { $acc } else { $acc | append [$y] @@ -226,7 +226,7 @@ def right_prompt [segment] { $segment | reduce -f [] {|x,acc| let y = (do $x.1 $x.0) - if $y.1 == $nothing { + if $y.1 == null { $acc } else { $acc | append [$y] @@ -292,8 +292,8 @@ def decorator_gen [ def squash [thunk] { mut r = "" for t in $thunk { - let v = (do $t.0 $nothing) - if ($v.1 != $nothing) { + let v = (do $t.0 null) + if ($v.1 != null) { $r += (do $t.1 $v.1) } } @@ -342,8 +342,8 @@ def up_prompt [segment] { | each {|y| $y | reduce -f [] {|x, acc| - let y = (do $x $nothing) - if $y.1 == $nothing { + let y = (do $x null) + if $y.1 == null { $acc } else { $acc | append $y.1 diff --git a/modules/prompt/powerline/power_kube.nu b/modules/prompt/powerline/power_kube.nu index d2e643e..15da53b 100644 --- a/modules/prompt/powerline/power_kube.nu +++ b/modules/prompt/powerline/power_kube.nu @@ -20,7 +20,7 @@ def "kube ctx" [] { $cache = $"($env.HOME)/.cache/nu-power/kube-($env.KUBECONFIG | str replace -a '/' ':').json" $file = $env.KUBECONFIG } - if not ($file | path exists) { return $nothing } + if not ($file | path exists) { return null } ensure-cache $cache $file { do -i { kubectl config get-contexts diff --git a/modules/virtual_environments/auto-venv/auto-venv.nu b/modules/virtual_environments/auto-venv/auto-venv.nu index 81f0d19..0250678 100644 --- a/modules/virtual_environments/auto-venv/auto-venv.nu +++ b/modules/virtual_environments/auto-venv/auto-venv.nu @@ -19,7 +19,7 @@ export-env { def default-hooks [] { - (if ($env.config.hooks.env_change.PWD != $nothing) { + (if ($env.config.hooks.env_change.PWD != null) { [$env.config.hooks.env_change.PWD] } else { diff --git a/modules/virtual_environments/auto-venv/path_extensions.nu b/modules/virtual_environments/auto-venv/path_extensions.nu index 65de624..1bf3937 100644 --- a/modules/virtual_environments/auto-venv/path_extensions.nu +++ b/modules/virtual_environments/auto-venv/path_extensions.nu @@ -29,7 +29,7 @@ export def "path check-sub" [ (ls -a $folder | where ( - ($type == $nothing or $it.type in $type) + ($type == null or $it.type in $type) and ($it.name | path basename) == $subfolder ) | length @@ -53,7 +53,7 @@ export def "path find-sub" [ ) ); - if ($paths != $nothing) and ($paths | length) > 0 { + if ($paths != null) and ($paths | length) > 0 { [ ($paths | first), $subfolder ] | path join } else {[]} } diff --git a/modules/virtual_environments/conda.nu b/modules/virtual_environments/conda.nu index a9e5e5a..4b06e7d 100644 --- a/modules/virtual_environments/conda.nu +++ b/modules/virtual_environments/conda.nu @@ -65,7 +65,7 @@ export def-env activate [ PROMPT_COMMAND: $new_prompt } } else { - $new_env | merge { CONDA_OLD_PROMPT_COMMAND: $nothing } + $new_env | merge { CONDA_OLD_PROMPT_COMMAND: null } } @@ -84,7 +84,7 @@ export def-env deactivate [] { hide-env CONDA_OLD_PATH $env.PROMPT_COMMAND = ( - if $env.CONDA_OLD_PROMPT_COMMAND == $nothing { + if $env.CONDA_OLD_PROMPT_COMMAND == null { $env.PROMPT_COMMAND } else { $env.CONDA_OLD_PROMPT_COMMAND diff --git a/modules/weather/get-weather.nu b/modules/weather/get-weather.nu index da3d3d7..6af251b 100644 --- a/modules/weather/get-weather.nu +++ b/modules/weather/get-weather.nu @@ -167,8 +167,8 @@ export def get_weather [ ] { let token = "85a4e3c55b73909f42c6a23ec35b7147" - let is_loc_empty = ($locIdx == $nothing) - let is_units_empty = ($units == $nothing) + let is_loc_empty = ($locIdx == null) + let is_units_empty = ($units == null) let no_loc_no_unit = ($is_loc_empty == true and $is_units_empty == true) let no_loc_with_unit = ($is_loc_empty == true and $is_units_empty == false) diff --git a/sourced/nu_101/flag.nu b/sourced/nu_101/flag.nu index 0a7a084..483ffa3 100644 --- a/sourced/nu_101/flag.nu +++ b/sourced/nu_101/flag.nu @@ -39,8 +39,8 @@ def get_flag [ --test_int(-i): int # The test intlocation --test_string(-s): string # The test string ] { - let is_int_empty = ($test_int == $nothing) - let is_string_empty = ($test_string == $nothing) + let is_int_empty = ($test_int == null) + let is_string_empty = ($test_string == null) let no_int_no_string = ($is_int_empty == true and $is_string_empty == true) let no_int_with_string = ($is_int_empty == true and $is_string_empty == false)