Repository navigation
Conversation
|
ah, ok. makes sense if #10205 has |
There was a problem hiding this comment.
this is cool, thanks for tackling this issue 🙏
it does not break my $env.EDITOR = "nvim" so i'm happy 😌
however, i only get these errors,
Error: nu::shell::cant_convert
× Can't convert to string or list<string>.
╭─[entry #2:1:1]
1 │ $env.EDITOR = ""
· ─┬
· ╰── can't convert string to string or list<string>
╰────Error: nu::shell::cant_convert
× Can't convert to string or list<string>.
╭─[entry #8:1:1]
1 │ $env.EDITOR = [ ]
· ─┬─
· ╰── can't convert list<any> to string or list<string>
╰────and never the first one in the source code, is that normal?
i.e. is there a way to get the $EDITOR or $VISUAL should be an non-empty String or List<String> error? 😋
|
@amtoine I forgot add error messages for them and now it works :)
Edit: Typo check fails for unknown reason 😢 |
|
Thanks for tackling this! Quick question: Do we need to make a similar change to |
|
@sholderbach |
so `nu-cli` can use it
|
this stills works with @Poyo-SSB |
|
5bc3863 make the same change to |
this makes me think we won't be able to land this PR until nushell/reedline#630 is released 🤔 |
This reverts commit 5bc3863.
|
Seems Now this pr is safe to be merged :) |
move `get_editor` to `cmd-base` so `nu-cli` can use it
move `get_editor` to `cmd-base` so `nu-cli` can use it
# Description This merges @horasal 's changes from #10246 and #10269 Closes #10205 Closes #8714 Fixes the bug that editor paths with spaces are unusable Closes #10210 Closes #10269 # User-Facing Changes You can now either pass a string with the name of the executable or a list with the executable and any flags to `$env.config.buffer_editor`/`$env.EDITOR`/`$env.VISUAL` Both the external buffer editor of reedline (by default bound to `Ctrl-o`) and the commands `config nu` and `config env` will respect those variables in the following order: 1. `$env.config.buffer_editor` 2. `$env.EDITOR` 3. `$env.VISUAL` Example: ``` $env.EDITOR = "nvim" # The system-wide EDITOR is neovim $env.config.buffer_editor = ["vim" "-p2"] # Force vim to open two tabs (not particularly useful) $env.config.buffer_editor = null # Unset `buffer_editor` -> Uses `$env.EDITOR` ergo nvim ``` # Tests + Formatting None --------- Co-authored-by: Horasal <[email protected]>
# Description This merges @horasal 's changes from nushell#10246 and nushell#10269 Closes nushell#10205 Closes nushell#8714 Fixes the bug that editor paths with spaces are unusable Closes nushell#10210 Closes nushell#10269 # User-Facing Changes You can now either pass a string with the name of the executable or a list with the executable and any flags to `$env.config.buffer_editor`/`$env.EDITOR`/`$env.VISUAL` Both the external buffer editor of reedline (by default bound to `Ctrl-o`) and the commands `config nu` and `config env` will respect those variables in the following order: 1. `$env.config.buffer_editor` 2. `$env.EDITOR` 3. `$env.VISUAL` Example: ``` $env.EDITOR = "nvim" # The system-wide EDITOR is neovim $env.config.buffer_editor = ["vim" "-p2"] # Force vim to open two tabs (not particularly useful) $env.config.buffer_editor = null # Unset `buffer_editor` -> Uses `$env.EDITOR` ergo nvim ``` # Tests + Formatting None --------- Co-authored-by: Horasal <[email protected]>

fixes #10205 without break #8051 as possible
Description
While dealing with #8051 , the function for using arguments in
editorvariable is introduced but it still only receivestringfor$env.VISUALand$env.EDITORso the input is just splitted by' 'to find arguments, and this finally causes #10205.As nushell provides
list<string>, it's more natural to use alistrather thanstringfor list of arguments.User-Facing Changes
$env.EDITOR = "string"is only considered as an executable$env.EDITOR = ["editor", "-argument"]to specify argumentsTests + Formatting
toolkit fmttoolkit clippytoolkit testtoolkit test stdlibAfter Submitting
Add what is allowed for these variables in https://nushell.sh/book/configuration.html#configurations-with-built-in-commands