Skip to content

Support multiple injections per file #8

Open

Description

@Markus00000

Currently, injection marker lines are matched greedily. If a file contains more than one pair of markers, all lines between the first and last marker are replaced:

  # %%base16_template: test-1##default %%
- # %%base16_template_end%%
-
- THIS WILL BE DELETED
-
- # %%base16_template: test-2##default %%
  # %%base16_template_end%%

Unsuspecting users might be surprised by this…

If the match were non-greedy, multiple marker blocks could be replaced in a file. For example, if two templates both set environment variables (like FZF_DEFAULT_OPTS), they could be injected into the same file.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions