Skip to content

Please allow a non-diff usage #150

Open
@AloisMahdal

Description

@AloisMahdal

Currently we can show diff of two files, but it would be useful to also be able to show a single file.

I know it can be done with highlight.js but in my use case I'm showing diffs as well as whole files on the same page and it would be much easier to manage consistent styling and behavior if I could just use v-code-diff for both. (I think vue-json-compare can do it but it's for Vue 2).

Note that providing two identical texts leads to almost-perfect result for me, except that there are still two columns of line numbers, which would be confusing to user. So what I would like to see is basically the same but with only single column of line numbers.

How would I expect v-code-diff API to change? I'm thinking of several ways

  • make one text optional and switch to single-file mode when it's missing
  • switch to single-file mode if both texts are identical (no change in API)
  • add single-file as a separate display mode (along with side-by-side, etc.)

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