1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 06:37:46 +00:00

fix: adjust for nushell commandline syntax deprecation (#840)

Fixes for changes introduced by
https://github.com/nushell/nushell/pull/12658
This commit is contained in:
winston 2024-05-19 20:33:08 +02:00 committed by GitHub
parent 8a77d51e93
commit 66c76a9dbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View file

@ -5,7 +5,7 @@
mode: [emacs, vi_normal, vi_insert] mode: [emacs, vi_normal, vi_insert]
event: { event: {
send: executehostcommand send: executehostcommand
cmd: "commandline -a ( cmd: "commandline edit --append (
ls **/* ls **/*
| where type == dir | where type == dir
| get name | get name

View file

@ -6,8 +6,8 @@
event: { event: {
send: executehostcommand send: executehostcommand
cmd: ' cmd: '
commandline --replace "use " commandline edit --replace "use "
commandline --insert ( commandline edit --insert (
$env.NU_LIB_DIRS $env.NU_LIB_DIRS
| each {|dir| | each {|dir|
ls ($dir | path join "**" "*.nu") ls ($dir | path join "**" "*.nu")

View file

@ -55,12 +55,12 @@ def "nu-complete list themes" [] {
# preview completion. For this to work, it should be ran from the nu_scripts folder # preview completion. For this to work, it should be ran from the nu_scripts folder
def preview [theme: string@"nu-complete list themes"] { def preview [theme: string@"nu-complete list themes"] {
commandline --insert $"use themes/themes/($theme).nu; $env.config.color_config = (char lparen)($theme)(char rparen); preview_theme | table -e" commandline edit --insert $"use themes/themes/($theme).nu; $env.config.color_config = (char lparen)($theme)(char rparen); preview_theme | table -e"
} }
# preview completion. For this to work, it should be ran from the nu_scripts folder # preview completion. For this to work, it should be ran from the nu_scripts folder
def preview_small [theme: string@"nu-complete list themes"] { def preview_small [theme: string@"nu-complete list themes"] {
commandline --insert $"use themes/themes/($theme).nu; $env.config.color_config = (char lparen)($theme)(char rparen); preview_theme_small | table -e" commandline edit --insert $"use themes/themes/($theme).nu; $env.config.color_config = (char lparen)($theme)(char rparen); preview_theme_small | table -e"
} }
# Preview the current nushell theme, small mode # Preview the current nushell theme, small mode
@ -109,4 +109,4 @@ def preview_theme_small [] {
let table2 = ($color_table | range $row_count_third..($row_count_third * 2) | rename key2 val2) let table2 = ($color_table | range $row_count_third..($row_count_third * 2) | rename key2 val2)
let table3 = ($color_table | range ($row_count_third * 2)..$row_count | rename key3 val3) let table3 = ($color_table | range ($row_count_third * 2)..$row_count | rename key3 val3)
echo $table1 | merge $table2 | merge $table3 echo $table1 | merge $table2 | merge $table3
} }