Skip to content

Syntax highlighting breaks for defs with multiple commands separated by ; (semicolon) #190

@chrisheib

Description

@chrisheib

Syntax highlighting currently doesn't seem to working correctly with defs consisting of multiple command.
I would expect e.g. the nrs command to highlight cur and gcp in the green function color.

def l [] { ls }
def ll [] { ls }
def nrt [] { sudo nixos-rebuild test }
def nrs [msg] { up; sudo nixos-rebuild switch; cur; gcp $msg; gc }
def nrsu [] { sudo nix-channel --update; nrs "System Update" }
def nrsb [msg] { nrs $msg; gut }
def nrsrepair [] { sudo nixos-rebuild switch --repair }
def gut [] { qdbus org.kde.Shutdown /Shutdown org.kde.Shutdown.logoutAndReboot }
def gcp [msg] { cd ~/.nixos; git add .; git commit -m $"Generation (cur): ($msg)"; git push; source $nu.config-path }
def cur [] { sudo nix-env --list-generations --profile /nix/var/nix/profiles/system | find current | split column " " | get column2.0 }
def up [] { sudo nix-channel --update; nixos-rebuild build --upgrade; nvd diff /run/current-system ./result | save -f nixdiff.txt; cat nixdiff.txt }
def gc [] { nix-collect-garbage --delete-older-than 7d }
# def top [] { btm }

(Ironically the github highlighting does the same mistakes, probably uses the same highlighter grammar 😁)

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions