-
Notifications
You must be signed in to change notification settings - Fork 2.1k
allow the use of const in a module #8248
Copy link
Copy link
Closed
Labels
A:parserIssues related to parsingIssues related to parsingcategory:enhancementNew feature or requestNew feature or requestsemanticsPlaces where we should define/clarify nushell's semanticsPlaces where we should define/clarify nushell's semantics
Milestone
Description
Related problem
i have some modules where i use preview strings for fzf that i want to define at the top level
Note
such a preview is just a string, containing some code, herebash, and that gets executed on each line of thefzffuzzy finder to show some preview, e.g. if the entries are file paths, the preview might show the content of the files in a panel to the side
before the recent alias rewrite, i used to define them as aliases, e.g.
alias FZF_PREVIEW = "..."and used as
fzf {options} --preview (FZF_LOG_PREVIEW)now, with the new change, i can not do that anymore and am, afaik, forced to do that as
def FZF_PREVIEW [] {"
...
"}Describe the solution you'd like
i think it could be cool to just be able to define constants in nushell modules
for instance,
const FZF_PREVIEW = "..."and then
fzf {options} --preview $FZF_PREVIEWDescribe alternatives you've considered
No response
Additional context and details
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:parserIssues related to parsingIssues related to parsingcategory:enhancementNew feature or requestNew feature or requestsemanticsPlaces where we should define/clarify nushell's semanticsPlaces where we should define/clarify nushell's semantics