Skip to content

Formatting breaks with specific types of in template strings strings #220

Description

@JustLinuxUser

Describe the bug

Formatting (parsing) breaks with some nested strings inside format strings.

Example:

> echo '$"("a:")"' | nufmt --stdin
$"(", a:")"

> echo '$"(http get "https://google.com")"' | nufmt --stdin
$"(http get ", https://google.com")"

When a similar sequence is present at any point in the script, none of it gets formatted

Environment

Please run show what operating system and version you're running and what version of nufmt you're running.

$nu.os-infonufmt --version

╭────────────────┬───────────────╮
│ name           │ linux         │
│ arch           │ x86_64        │
│ family         │ unix          │
│ kernel_version │ 7.2.4-arch1-2 │
╰────────────────┴───────────────╯
nufmt 0.1.4

My Observations about the bug:

This appears to only happen when somewhere inside a template string, there is a string with a :, and something else preceding the colon. Doesn't happen when using nested 'single quote' string

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions