Skip to content

Two improvements that should be done to the word wrapping logic in PowerShell formatting #26526

@daxian-dbw

Description

@daxian-dbw

Summary of the new feature / enhancement

There are 2 improvements that should be made to the word wrapping logic in PowerShell formatting:

  1. There are places where we check for "\x1b[0m" (reset) but no "\x1b[m" in files like ComplexWriter.cs, ListWriter.cs and more. (see Fix formatting to properly handle the Reset VT sequences that appear in the middle of a string #26424 (comment))
  2. The GetWords(string) implementation in ComplexWriter.cs doesn't handle consecutive spaces efficiently -- it breaks every space character into a word in this case, which has poor performance.

We should ideally address those 2 issues to make the word wrapping logic more robust and efficient.

Proposed technical implementation details (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugNeeds-TriageThe issue is new and needs to be triaged by a work group.WG-Engine-Format

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions