Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

allow flatshape (command line syntax) theming #502

Merged
merged 2 commits into from
Dec 16, 2021
Merged

allow flatshape (command line syntax) theming #502

merged 2 commits into from
Dec 16, 2021

Conversation

fdncred
Copy link
Contributor

@fdncred fdncred commented Dec 16, 2021

This pr allows one to specify alternate colors for the flat shapes that are used in the cli command line.

I also separate out the config into a nu-color-config crate so that it could be used in multiple places without having circular references. I ran into some issues implementing this that pushed me to move it into its own crate.

I also ran into a problem where versions of nu-ansi-term were conflicting with each other and/or reedline's version. To combat that, I commented out all of them pointing to ../nu-ansi-term and just pointed them to the crates.io version. I'd like to fix this but I'm not sure how.

example color_config with the "red" theme.

let config = {
  color_config: {
    separator: $base03
    leading_trailing_space_bg: $base04
    header: $base0b
    date: $base0e
    filesize: $base0d
    row_index: $base0c
    bool: $base08
    int: $base0b
    duration: $base08
    range: $base08
    float: $base08
    string: $base04
    nothing: $base08
    binary: $base08
    cellpath: $base08

    # below are the cli syntax colors
    flatshape_garbage: red
    flatshape_bool: red
    flatshape_int: red
    flatshape_float: red
    flatshape_range: red
    flatshape_internalcall: red
    flatshape_external: red
    flatshape_externalarg: red
    flatshape_literal: red
    flatshape_operator: red
    flatshape_signature: red
    flatshape_string: red
    flatshape_filepath: red
    flatshape_globpattern: red
    flatshape_variable: red
    flatshape_flag: red
    flatshape_custom: red
  }
}

Screen Shot 2021-12-15 at 7 27 15 PM

@fdncred fdncred marked this pull request as ready for review December 16, 2021 12:17
@fdncred fdncred merged commit 9a864b5 into nushell:main Dec 16, 2021
@fdncred fdncred deleted the allow_flatshape_theming branch December 16, 2021 12:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant