Skip to content

Tab count compare bug #23636

Closed
Closed

Description

  • VSCode Version: Tested on 1.7-1.10
  • OS Version: Win7

Steps to Reproduce:

1.Open
1.txt
2.txt
2.Compare
3.You will see compare is incorrect and is full different
tab1
4.If you add 1 Tab to all lines in 2.txt compare will result correct diff only in tabs
tab2

Activity

  1. alexdima commented on Mar 30, 2017

    @alexdima
    Member

    ][Noname][ (@justnonamenoname)

    Could you please attach the two txt files on github?

    Here's what I get on gta-samp.com
    image

  2. added
    info-needed
    on Mar 30, 2017
  3. justnonamenoname commented on Mar 30, 2017

    @justnonamenoname
    Author
  4. alexdima commented on Mar 30, 2017

    @alexdima
    Member

    Thank you. This appears to be a case of changes only to the whitespace. The diff editor falls back to character-by-character comparison in case the lines differ only via whitespace.

    23636

  5. added
    diff-editor
    bug
    and removed
    info-needed
    on Mar 30, 2017
  6. alexdima commented on Jul 5, 2017

    @alexdima
    Member

    I reimplemented how diffing works when trim whitespace is not ignored:

    • first compute a diff with trim whitespace ignored
    • then do line-level trim whitespace diffing for lines which are equal when trim whitespace is ignored.
    • IMHO, this gives the best result w.r.t. what we'd expect:

    before:

    screen shot 2017-07-05 at 09 50 47

    after:

    screen shot 2017-07-05 at 09 48 29

  7. added
    verified
    on Aug 2, 2017
  8. locked and limited conversation to collaborators on Nov 17, 2017
  9. added a commit that references this issue on Sep 6, 2026
    9cde977
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugdiff-editorverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions