Skip to content

Highlighter incorrectly inserts character in row conditions #15899

Closed as duplicate

Description

@132ikl

Describe the bug

Sometimes, nu-highlight will insert characters which don't exist in the source. I've seen this happen a couple times, but I think it might be confined to row conditions. It happens when typing at the REPL (which is very confusing), but easier to inspect by calling nu-highlight explicitly.

How to reproduce

styling is stripped since github, but you can see the extra parenthesis:

"where not (foo" | nu-highlight)
# => where not ((foo

Expected behavior

Don't insert extra characters

Configuration

key value
version 0.104.2
major 0
minor 104
patch 2
branch makepkg
commit_hash ed7b261
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.85.1 (4eb161250 2025-03-15)
rust_channel 1.85.1-x86_64-unknown-linux-gnu
cargo_version cargo 1.85.1 (d73d2caf9 2024-12-31)
build_time 2025-06-05 08:00:31 +00:00
build_rust_channel release
allocator standard
features default, sqlite, trash
installed_plugins custom_values 0.1.0, example 0.104.2, explore_ir 0.6.0, formats 0.104.2, gstat 0.104.2, inc 0.104.2, polars 0.101.1, query 0.104.2, stress_internals 0.104.2

Activity

  1. added
    category:bug
    A:syntax-highlighting
    on Jun 5, 2025
  2. 132ikl commented on Jun 5, 2025

    @132ikl
    MemberAuthor

    this specific example I bisected to #15697 (cc @Bahex)

    ...but there's probably some underlying issue here because I don't exactly see why that should cause an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:syntax-highlightingcategory:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions