Skip to content

Multiline replacement does not seem to respect the range #31

Description

@nerdo

When trying to do a replacement with multiline mode /m, when operating on either the visual range or a specific range, the range doesn't seem to be respected.

For example, if the file is...

abc
def
iWantThis: value
hjk
lmn
opq
rst

And I do :2,4S/.*iWantThis: (\w+).*/\1/m

The result is a file that looks like:

abc
value

but I'm expecting

abc
value
lmn
opq
rst

Doing a non-greedy match at the end sort of solves it, but the range should be respected since the input should be the range, not the entire buffer... I suspect this has something to do with being able to support lookahead outside of a range??

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions