Skip to content

$env.config.color_config.shape_and/shape_or are not used #14372

Closed
@NotTheDr01ds

Description

@NotTheDr01ds

Describe the bug

Setting/changing $env.config.color_config.shape_and (and ...shape_or) has no effect.

As far as I can tell, there's simply no code-path that uses these settings. nu-parser::flatten should have a match arm in flatten_expression_into() for these operators, along with a corresponding output.push(), but I don't see either.

How to reproduce

$env.config.color_config.shape_and = 'red'
if (true and false) { "No" }

Notice that the and is still styled with the shape_operator setting.

Expected behavior

The and and or operators would be styled differently based on the value.

I haven't looked at the history yet, but I'm assuming that someone at some point saw value in styling these differently, and I agree there is.

In the meantime, they at least fall-through as style_operator.

Configuration

key value
version 0.100.0
major 0
minor 100
patch 0
branch main
commit_hash 30f98f7
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.80.1 (3f5fd8dd4 2024-08-06)
rust_channel 1.80.1-x86_64-unknown-linux-gnu
cargo_version cargo 1.80.1 (376290515 2024-07-16)
build_time 2024-11-13 06:35:04 -05:00
build_rust_channel release
allocator mimalloc
features default, sqlite, trash
installed_plugins

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageAn issue that hasn't had any proper looksyntax-highlightingBugs or performance issues with the syntax highlighting logic

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions