Skip to content

Weird results of Move command in chained method calls #7

@reuben

Description

@reuben
const normSpaceText = text
    .replaceAll('\x1F', '')
    .replaceAll(/  +/gu, ' ')
    .replaceAll(/a ?\.k ?\.a/gu, 'aka')
    .replaceAll(/e ?\.g/gu, 'eg')
    .replace(WORD_SEPARATOR_END, '');

I tried to use Move left/right to reorder the calls, but it just does weird stuff. If I move the cursor to the first replace|All (| is cursor) and use Move right this happens:

const normSpaceText = replaceAll
    .text
    .replaceAll('\x1F', '')(/  +/gu, ' ')
    .replaceAll(/a ?\.k ?\.a/gu, 'aka')
    .replaceAll(/e ?\.g/gu, 'eg')
    .replace(WORD_SEPARATOR_END, '');

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions