Skip to content

multi_pass for non-scoped replacements for commands with multiple steps #116

@God-damnit-all

Description

@God-damnit-all

What I would like:

  {
    "caption": "Regex: My Non-Scoped Replacements",
    "command": "reg_replace",
    "args": { "replacements": ["step1_singlepass", "step2_multipass", "step3_singlepass"] }
  }

Steps 1 and 3 are assumed to meant to be a single-pass and Step 2 is assumed to be multi-pass. However, unless you're targeting a scope, this doesn't work because multi_pass on a replacement requires scope to be defined.

And if you do:

  {
    "caption": "Regex: My Non-Scoped Replacements",
    "command": "reg_replace",
    "args": { "replacements": ["step1_singlepass", "step2_multipass", "step3_singlepass"], "multi_pass": true }
  }

... this makes Step 1 and Step 3 multi-pass, which will mess up my operation.

Right now, I have to split this into 3 separate commands or do something more complicated.

If you could allow multi_pass to be definable for all replacements, that'd be great.

As for how it would work when using the command-level multi_pass, maybe make it so if it's defined in replacements, it will override whatever it's set to. So, you could define multi_pass: false to make it so a replacement in a command that uses multi_pass: true only runs a single pass. Or, I guess you could do it the other way around where the command-level multi_pass takes precedence, though I think that wouldn't be as useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P: maybePending approval of low priority request.T: featureFeature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions