Skip to content

diffChars case insensitive #128

Closed
Closed
@thomasdebruin

Description

@thomasdebruin

Is there a way to do a caseless insensitive compare with diffChars? And in the result use either the case from oldStr or newStr when it comes to matches?

Right now I'm, thinking of lowercasing both oldStr & newStr before calling diffChars. Then when iterating on the output: find the original string (not lowecased) in the user input for the matches.
But this could probably result in unpredictable outcome when certain matches occur multiple times with different case.

Other approach could be to modify the plugin, and lowercase on the point where the comparing is done wothout modifying the case of what's returned. But the code looks pretty complex, but I will give it a try.

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